Is there a way to use capabilities in .convos text file?

Hi,

I am using botium-cli, fb-webhook connector and botium-core for my chatbot automation.

I setup some capabilities like user id in botium.json

I wanted to use those capabilities in my scrip covo file. Can we do that?

Thanks

https://botium-docs.readthedocs.io/en/latest/05_botiumscript/index.html#scripting-memory-functions

Thanks @Florian ,

I went through the documentation.

I added SCRIPTING_ENABLE_MEMORY = true in botium.json

added --expandscriptingmemory 1 to my command and trying to use $cap(<capability_name>) inside my convo file. I am not able to read through the capability value.

Is there anything that I missed?

–expandscriptingmemory switch is not required for this. Pls post the verbose log output.

@Florian, it worked with the same command. Thanks :slight_smile: However, it is not printing the values in the mochawesome reports. it is simply printing $cap(<cap_name>)

Hi @Florian, I tried it once again and it is failing.

here is the verbose response.

botium-connector-simplerest constructed requestOptions {
  botium-connector-simplerest   "uri": "https://api-ap-south-1.nivi.io/facebook/staging/receive",
  botium-connector-simplerest   "method": "POST",
  botium-connector-simplerest   "followAllRedirects": true,
  botium-connector-simplerest   "timeout": 10000,
  botium-connector-simplerest   "body": {
  botium-connector-simplerest     "user_type": "botium",
  botium-connector-simplerest     "object": "page",
  botium-connector-simplerest     "entry": [
  botium-connector-simplerest       {
  botium-connector-simplerest         "messaging": [
  botium-connector-simplerest           {
  botium-connector-simplerest             "message": {
  botium-connector-simplerest               "text": "reset $cap(FBWEBHOOK_USERID)",
  botium-connector-simplerest               "mid": "mid.2812784808"
  botium-connector-simplerest             },
  botium-connector-simplerest             "sender": {
  botium-connector-simplerest               "id": "BOTIUM0000000002"
  botium-connector-simplerest             },
  botium-connector-simplerest             "recipient": {
  botium-connector-simplerest               "id": "2534267439972096"
  botium-connector-simplerest             },
  botium-connector-simplerest             "timestamp": 1629467355734
  botium-connector-simplerest           }
  botium-connector-simplerest         ],
  botium-connector-simplerest         "time": 1629467355734,
  botium-connector-simplerest         "id": "2534267439972096"
  botium-connector-simplerest       }
  botium-connector-simplerest     ]
  botium-connector-simplerest   },
  botium-connector-simplerest   "json": true,
  botium-connector-simplerest   "strictSSL": true,
  botium-connector-simplerest   "headers": {
  botium-connector-simplerest     "X-Hub-Signature": "sha1=2473a83bf295b180396655b7cabac366dd2cba53",
  botium-connector-simplerest     "Botium": true
  botium-connector-simplerest   }
  botium-connector-simplerest } +13ms
  botium-connector-simplerest got response code: 200, body: {
  botium-connector-simplerest   "response": "Request Sent Successfully"
  botium-connector-simplerest } +645ms
  botium-connector-simplerest Async body is queued for processing. +0ms
  botium-connector-simplerest current session context: { response: 'Request Sent Successfully' } +5ms
  botium-connector-fbwebhook Response Body: { response: 'Request Sent Successfully' } +760ms
  botium-connector-fbwebhook WARNING: received non message fb event +1ms
  botium-core-Convo Verify_Successful_User_Onboarding/Line 6: user says (cleaned by binary and base64 data and sourceData) {
  botium-core-Convo   "sender": "me",
  botium-core-Convo   "channel": null,
  botium-core-Convo   "not": false,
  botium-core-Convo   "optional": false,
  botium-core-Convo   "messageText": null,
  botium-core-Convo   "media": null,
  botium-core-Convo   "buttons": null,
  botium-core-Convo   "cards": null,
  botium-core-Convo   "forms": null,
  botium-core-Convo   "attachments": null,
  botium-core-Convo   "asserters": [],
  botium-core-Convo   "userInputs": [],
  botium-core-Convo   "logicHooks": [
  botium-core-Convo     {
  botium-core-Convo       "name": "PAUSE",
  botium-core-Convo       "args": [
  botium-core-Convo         "30000"
  botium-core-Convo       ]
  botium-core-Convo     }
  botium-core-Convo   ]
  botium-core-Convo } +660ms
  botium-connector-simplerest constructed requestOptions {
  botium-connector-simplerest   "uri": "https://api-ap-south-1.nivi.io/facebook/staging/receive",
  botium-connector-simplerest   "method": "POST",
  botium-connector-simplerest   "followAllRedirects": true,
  botium-connector-simplerest   "timeout": 10000,
  botium-connector-simplerest   "body": {
  botium-connector-simplerest     "user_type": "botium",
  botium-connector-simplerest     "object": "page",
  botium-connector-simplerest     "entry": [
  botium-connector-simplerest       {
  botium-connector-simplerest         "messaging": [
  botium-connector-simplerest           {
  botium-connector-simplerest             "message": {
  botium-connector-simplerest               "text": null,
  botium-connector-simplerest               "mid": "mid.8479807995"
  botium-connector-simplerest             },
  botium-connector-simplerest             "sender": {
  botium-connector-simplerest               "id": "BOTIUM0000000002"
  botium-connector-simplerest             },
  botium-connector-simplerest             "recipient": {
  botium-connector-simplerest               "id": "2534267439972096"
  botium-connector-simplerest             },
  botium-connector-simplerest             "timestamp": 1629467356392
  botium-connector-simplerest           }
  botium-connector-simplerest         ],
  botium-connector-simplerest         "time": 1629467356392,
  botium-connector-simplerest         "id": "2534267439972096"
  botium-connector-simplerest       }
  botium-connector-simplerest     ]
  botium-connector-simplerest   },
  botium-connector-simplerest   "json": true,
  botium-connector-simplerest   "strictSSL": true,
  botium-connector-simplerest   "headers": {
  botium-connector-simplerest     "X-Hub-Signature": "sha1=23ca8a4512027a38c8c64099385c329f1be05ce2",
  botium-connector-simplerest     "Botium": true
  botium-connector-simplerest   }
  botium-connector-simplerest } +7ms
  botium-connector-simplerest got response code: 200, body: {
  botium-connector-simplerest   "response": "Request Sent Successfully"
  botium-connector-simplerest } +583ms
  botium-connector-simplerest Async body is queued for processing. +0ms
  botium-connector-simplerest current session context: { response: 'Request Sent Successfully' } +4ms
  botium-connector-fbwebhook Response Body: { response: 'Request Sent Successfully' } +594ms

thanks have to check this

@Sagar_Karathiya, its working for me.

Are you sure you added the flag well to botium.json?

"Capabilities": {
  "CONTAINERMODE": "...",
  "SCRIPTING_ENABLE_MEMORY": true,

Please check caps in log too:

botium-core-BotDriver Build - Capabilites: {
...
botium-core-BotDriver   SCRIPTING_ENABLE_MEMORY: true,
2 Likes

Thanks @ujja, I missed to add “SCRIPTING_ENABLE_MEMORY” capability.

Working totally as expected now.

1 Like