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?
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');
}
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');
}
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
I'm not sure. You might need to open a chat so we can look at the code.