Dialog Problem in Chrome

  1. I have a recorded test that when trying to navigate off of one of the screens to another screen using the FireFox browser it functions as expected. But when I conduct the same test using the Chrome browser the browser displays the dialog you see below for a few seconds then it disappears and I am not able to respond to it before it disappears so I cannot navigate off the screen. The dialog disappearing after a few seconds only happens from within the Katalon Studio recording. If I perform the exact same function outside Katalon Studio using Chrome the dialog does not go away so I am able to respond to it. Can you tell me what I need to do within Katalon Studio to make the dialog display until it is responded to? Thank You
    ChromeDialog

I think a standard alert or confirm dialog is how Selenium handles these.

Failing that, as a last resort, you could use this JavaScript before you reach that point in your test case:

WebUI.executeJavaScript("window.onbeforeunload = null;")

I am using a recorded test and not a scripted test. Is there a way to add the line above to execute before my recorded script? Sorry I am new to this. Thanks for your help.

Just switch to Script view. Read the test steps (I promise you, it’s not scary). Find the appropriate spot and paste that line of code.

WARNING: When you paste the code, MAKE SURE the quotes are regular double quotes > " and ". The forum software sometimes changes them to smart quotes which will break your code.

Hi, I am having the same issue. Can someone help if this issue was resolved for you?