How to make script taking new user id for each test case

Hi,

I am using fb-webhook connector to connect with my messenger bot. Below is my directory structure.
Root → <test_scenario_convo_directory> → <child_directory>

The <child_directory> consists of 10 convo files.

Right now, when I am executing the tests using
npx botium-cli run mochawesome --convos ./spec/convo/<test_scenario_dir>/<child_dir>/ --timeout 120000 --reporter-options reportDir=<report_dir_name>

It is taking same user id(randomly generated) for all 10 test conversations under <child_dir>

Is there any way to assign different randomly generated ids to each convo/test execution?

You can use the UPDATE_CUSTOM logic hook to set a different user id for each test case:

#begin
UPDATE_CUSTOM FBWEBHOOK_USERID|66666666

Should also be possible to additionally use the “random” scripting memory function to generate a new one everytime:

#begin
UPDATE_CUSTOM FBWEBHOOK_USERID|$random(15)
1 Like

@Florian , Ohh I saw this random() function inside index.js of fb-webhook-connector. Was not sure about its usage with UPDATE_CUSTOM.

Let me try this out.

This helped. Working as per my expectation. Thanks for this guidance @Florian

1 Like