05 Jan 2023 07:45 AM - edited 05 Jan 2023 07:46 AM
I have configured few browser monitoring for which i want to create a content validation if multiple "Queued" status is shown in page. This will tell me if there are more than one job that is queued. Is there a way to do this?
05 Jan 2023 10:30 AM
Yes, you can use a JavaScript event to vaidate the value of multiple jobs
.
23 Jan 2023 07:26 AM
Hi Hannah,
I have tried the below snippet in order to check if there are "Queued" status but it doesnt work. I need your suggestion on how to check for multiple of same string and alert should fire if the count of string is greater than 5.
//Check status of the queued jobs
// If the status is queued for more than 4 jobs, fail monitor
text = 'Queued'
text1 = scheduledReports.innerText;
api.info(text1);
if (text1.indexOf(text) > -1) {
api.fail('Reports are in queued status');
}
24 Jan 2023 06:52 PM
Does .match().length do what you want?
//Check status of the queued jobs
// If the status is queued for more than 4 jobs, fail monitor
text = 'Queued'
text1 = scheduledReports.innerText;
api.info(text1);
if (text1.match(text).length > 4) {
api.fail('Reports are in queued status');
}
25 Jan 2023 09:03 AM
Hey Hannah,
Thanks for your response. I did try using the "text1.match(text).length > 4" but it shows "Your last playback was successful" even when there were 5 queued jobs.
Is there anything i am missing here?
Thanks
03 Feb 2023 12:10 PM
I'm not sure. You might need to open a chat so we can look at the code.