SET_SCRIPTING_MEMORY using variable multiple times

#begin
SET_SCRIPTING_MEMORY name|john
SET_SCRIPTING_MEMORY number|$random(10)

#me
i am $name and this is my $number, you can call me anytime. thanks $name

#bot
...

in the above example the first $name variable is getting replaced, but the second one is skipped from replace. is there a setting on config available to replace all.

@dinudany

I was not able to reproduce it. I used your conversation, and for me the result was

i am john and this is my 7796478542, you can call me anytime. thanks john

you sure the second one is not replaced? Can you send verbose log please?

If you have botium box, then could you run the convo on some simple chatbot like echo bot?

i am having this issue on botium-cli

Botium Box and Botium CLI are both based on Botium Core, so the outcome should actually be the same.
Can you please send verbose log (add –verbose flag to Botium CLI)

1 Like

npm info it worked if it ends with ok
npm verb cli [ ‘/usr/local/Cellar/nvm/0.38.0/versions/node/v10.16.3/bin/node’,
npm verb cli ‘/usr/local/opt/nvm/versions/node/v10.16.3/bin/npm’,
npm verb cli ‘run’,
npm verb cli ‘test:smoke’,
npm verb cli ‘–verbose’,
npm verb cli ‘–’,
npm verb cli ‘–grep’,
npm verb cli ‘C49503’ ]
npm info using npm@6.13.4
npm info using node@v10.16.3
npm verb run-script [ ‘pretest:smoke’, ‘test:smoke’, ‘posttest:smoke’ ]
npm info lifecycle testing-service@1.0.0~pretest:smoke: testing-service@1.0.0
npm info lifecycle testing-service@1.0.0~test:smoke: testing-service@1.0.0

testing-service@1.0.0 test:smoke /Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service
cross-env BOTIUM_CONFIG=botium.smoke.json npx mocha --reporter mochawesome --reporter-options “reportDir=reports,reportFilename=smoke.html,code=false” --exit e2e/botium_smoke.spec.js “–grep” “C49503”

smoke
{ host: ‘xxxxxxx.xxxxxxx.com’,
port: ‘xxxxx’,
protocol: ‘http:’ }
HttpsProxyAgent {
_events: [Object: null prototype] {},
_eventsCount: 0,
_maxListeners: undefined,
timeout: null,
maxFreeSockets: 1,
maxSockets: 1,
sockets: {},
requests: {},
secureProxy: false,
proxy:
{ host: ‘xxxxxxx.xxxxxxx.com’, port: xxxxx, protocol: ‘http:’ } }
1) C49503

0 passing (10s)
1 failing

  1. smoke
    C49503:
    TranscriptError: C49503/Line 27: Expected bot response (on Line 20: #me - Flight status arrived XX156 today) “ArrivedXX 156Terminal 1Terminal 3Muscat (MCT)Dubai (DXB)Departed:04:43Sun 30 MayArrived:05:42Sun 30 MayScheduled Departure: 04:40Scheduled Arrival: 05:55” to match one of “ArrivedXX \d{3}\w{2,20}.\w{2,20}.\w{2,20} (\w{3})\w{2,20} (\w{3})Departed:\d{2}:\d{2}\w{3} \d{2} \w{3}$arrivalTerminalArrived:\d{2}:\d{2}\w{3} \d{2} \w{3}Scheduled Departure: \d{2}:\d{2}Scheduled Arrival: \d{2}:\d{2}”
    at async.waterfall (node_modules/botium-core/src/scripting/Convo.js:225:25)
    at wrapper (node_modules/async/dist/async.js:268:20)
    at next (node_modules/async/dist/async.js:4582:24)
    at /Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service/node_modules/async/dist/async.js:321:20
    at runConversation (node_modules/botium-core/src/scripting/Convo.js:203:15)
    at async.mapSeries (node_modules/botium-core/src/scripting/Convo.js:437:9)
    at err (node_modules/async/dist/async.js:248:13)
    at wrapper (node_modules/async/dist/async.js:268:20)
    at iterateeCallback (node_modules/async/dist/async.js:413:21)
    at /Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service/node_modules/async/dist/async.js:321:20
    at _iteratee (node_modules/async/dist/async.js:245:17)
    at convoStepDone (node_modules/botium-core/src/scripting/Convo.js:269:11)
    at scriptingEvents.onBotStart.then.then (node_modules/botium-core/src/scripting/Convo.js:368:30)
    at process._tickCallback (internal/process/next_tick.js:68:7)

[mochawesome] Report JSON saved to /Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service/reports/smoke.json

[mochawesome] Report HTML saved to /Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service/reports/smoke.html

npm verb lifecycle testing-service@1.0.0~test:smoke: unsafe-perm in lifecycle true
npm verb lifecycle testing-service@1.0.0~test:smoke: PATH: /usr/local/Cellar/nvm/0.38.0/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service/node_modules/.bin:/usr/local/opt/nvm/versions/node/v10.16.3/bin:/Applications/Visual Studio Code.app/Contents/Resources/app/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools
npm verb lifecycle testing-service@1.0.0~test:smoke: CWD: /Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service
npm info lifecycle testing-service@1.0.0~test:smoke: Failed to exec test:smoke script
npm verb stack Error: testing-service@1.0.0 test:smoke: cross-env BOTIUM_CONFIG=botium.smoke.json npx mocha --reporter mochawesome --reporter-options "reportDir=reports,reportFilename=smoke.html,code=false" --exit e2e/botium_smoke.spec.js "--grep" "C49503"
npm verb stack Exit status 1
npm verb stack at EventEmitter. (/usr/local/Cellar/nvm/0.38.0/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
npm verb stack at EventEmitter.emit (events.js:198:13)
npm verb stack at ChildProcess. (/usr/local/Cellar/nvm/0.38.0/versions/node/v10.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack at ChildProcess.emit (events.js:198:13)
npm verb stack at maybeClose (internal/child_process.js:982:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm verb pkgid testing-service@1.0.0
npm verb cwd /Users/xxxxxx.xxxxxxxxxxx/Workspace/platform-bot/XX/testing-service
npm verb Darwin 20.3.0
npm verb argv “/usr/local/Cellar/nvm/0.38.0/versions/node/v10.16.3/bin/node” “/usr/local/opt/nvm/versions/node/v10.16.3/bin/npm” “run” “test:smoke” “–verbose” “–” “–grep” “C49503”
npm verb node v10.16.3
npm verb npm v6.13.4
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! testing-service@1.0.0 test:smoke: cross-env BOTIUM_CONFIG=botium.smoke.json npx mocha --reporter mochawesome --reporter-options "reportDir=reports,reportFilename=smoke.html,code=false" --exit e2e/botium_smoke.spec.js "--grep" "C49503"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the testing-service@1.0.0 test:smoke script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 11057ms

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/xxxxxx.xxxxxxxxxxx/.npm/_logs/2021-05-30T09_11_12_194Z-debug.log

Hi, this is not the verbose output that we need … when using the –verbose flag we can see what Scripting Memory replacements are actually happening and what matching functions are used.