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

Synthetic Monitoring with Multiple Users

VenkataSainath
Participant

Hi,

 

Can we Run the One synthetic Browser or Click path Monitoring with Multiple Users(i.e Passing multiple user s).

 

Regards,

Venkat

3 REPLIES 3

HannahM
Dynatrace Champion
Dynatrace Champion

Can you clarify what you mean? You can randomly select a user to use for logging in and pass the credentials to a variable to use at the relevant points and you can also use code to use a different user to log in to each location. You need to use a JavaScript event to do this. You can find more information here

VenkataSainath
Participant

Yes, We are trying to pass different users with the same transaction.

Q: you can also use code to use a different user to log in to each location? Is this possible?

Cool, yes, you can use api.getContext() to use a different login for each location. You would want something like this:

 

//Default Value
var userid_by_loc = "ValueDoesNotExist";
try {
var loc = api.getContext().location.name;
api.info("Location Name is: " + loc);
var platform = api.getContext().location.cloudPlatform;
api.info("Cloud Platform is: " + platform);
//set parameter(s)
if ((loc.indexOf("Los Angeles") >= 0) && (platform.includes("Google Cloud") >= 0)) {
userid_by_loc = 'LA_User';
} else if ((loc.indexOf("Oregon") >= 0) && (platform.includes("Google Cloud") >= 0)) {
userid_by_loc = 'Oregon_User';
} else if ((loc.indexOf("Chicago") >= 0) && (platform.includes("Azure") >= 0)) {
userid_by_loc = 'Chicago_User';
}
} catch (err) {
api.info("Error message: " + err.description);
}
api.setValue("UserID", userid_by_loc);

You could use Credentials Vault values if you prefer.