cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Run the Synthetic script with different input values

GAnantula
Newcomer

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

4 REPLIES 4

HannahM
Dynatrace Pro
Dynatrace Pro

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

GAnantula
Newcomer

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!

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?

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.