on 11 Apr 2023 03:50 PM
In some cases, the application triggers the popup which seems to be intermittent. During browser click path record, we may the record the click event to close the popup. However this popup appear intermittent and we may get the intermittent errors.
To avoid this, we can add the conditional JavaScript code with help of JavaScript Event to close the popup whenever it founds. You can follow the below steps on this case,
Go to the relevant page on Chrome browser
Right click on the element which you want to interact with on the popup page-> Inspect the element which will open the developer tools
Check the element tag and attributes and write a JavaScript code like which will check the length of the element and if its greater than 0 then it will perform the click else it will go for further actions on Browser click path monitors.
if(document.querySelectorAll('button[class="btn cancel"]').length>0) // For example on this page, element tag is button and attribute is class="btn cancel" . You can modify this based on your application page.
{
document.querySelector('button[class="btn cancel"]').click();
}
Add this JavaScript code into the JavaScript Event of your Browser click path monitor as shown in the below image,