22 Mar 2022 07:06 AM
Hi,
Can we Run the One synthetic Browser or Click path Monitoring with Multiple Users(i.e Passing multiple user s).
Regards,
Venkat
Solved! Go to Solution.
22 Mar 2022 09:27 AM
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
22 Mar 2022 09:36 AM
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?
22 Mar 2022 10:02 AM
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.