15 Oct 2020 11:18 PM
I have a quick question regarding the Synthetic scripts. We have a synthetic script which has few steps in it. We would like to run that particular script n times with different sets of data, like logging in with 10 different users one after the other. Is this doable using any scripts?
Or can we have Synthetic script pick a different value to log in with on each execution? Appreciate any help on this. Thanks, Ganesh
Solved! Go to Solution.
16 Oct 2020 08:52 AM
Hi Ganesh,
yes, you can pick different logins at execution time. You can do this with a JavaScript event and randomly, or not so randomly, pick which set of credentials to use and then set the value of placeholders in your script.
You could also duplicate the steps within a monitor and have each set log in and log out for different users. The first user would have uncached page and the others would be cached though.
There is no option to have a single script run multiple times with different credentials. You can duplicate scripts but would need to then keep them all separately updated.
Best wishes, Hannah
16 Oct 2020 04:10 PM
Thanks for the explanation! So, in a nutshell, there is no option to have a single script and run multiple times with different credentials. Thanks a lot!
17 Oct 2020 10:13 AM
Hi Ganesh,
Indeed, the Javascript option is pretty versatile. And it's pretty simple: you get an array with the logins/passwords, and use one of them at each invocation.
Now, if you want to run exactly one after another, you might have some issues, as state is not saved between executions. @Hannah M., do you have an idea how state could be saved between executions?
19 Oct 2020 01:31 PM
No, as you mention state is not saved between executions. Only way to do that that would be to duplicate the events and run them all in the same monitor.