Unable to click pop up alert disappearing

Hi Expert,

Need help in solving the issue in accepting pop-up alert seems that “WebUI.acceptAlert()” does not work.

Codes:
WebUI.click(findTestObject(‘Object Repository/Object/save_button’))
WebUI.waitForAlert(5, FailureHandling.STOP_ON_FAILURE)
WebUI.acceptAlert()

Errors:

=============== ROOT CAUSE =====================
Caused by: org.openqa.selenium.NoAlertPresentException: no such alert

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

02-08-2022 07:15:57 AM acceptAlert()

Elapsed time: 5.306s

Unable to accept alert (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to accept alert
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.AcceptAlertKeyword.acceptAlert(AcceptAlertKeyword.groovy:71)
at com.kms.katalon.core.webui.keyword.builtin.AcceptAlertKeyword.execute(AcceptAlertKeyword.groovy:66)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.acceptAlert(WebUiBuiltInKeywords.groovy:1522)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$acceptAlert$5.call(Unknown Source)
at CreateOnsiteID.run(CreateOnsiteID:55)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:442)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:433)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:412)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:404)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:281)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:202)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:164)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:105)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:181)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1644275623508.run(TempTestSuite1644275623508.groovy:36)
Caused by: org.openqa.selenium.NoAlertPresentException: no such alert
(Session info: chrome=97.0.4692.99)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘MOACGFPEGAD019’, ip: ‘192.168.43.27’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 97.0.4692.99, chrome: {chromedriverVersion: 96.0.4664.45 (76e4c1bb2ab46…, userDataDir: C:\Users\CRIS~1.DAP\AppData…}, goog:chromeOptions: {debuggerAddress: localhost:64238}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: d3295ecca83c8c05e0155cdaa1b8e4eb
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:19)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:609)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteAlert.accept(RemoteWebDriver.java:947)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringAlert.accept(EventFiringWebDriver.java:795)
at com.kms.katalon.core.webui.keyword.builtin.AcceptAlertKeyword$_acceptAlert_closure1.doCall(AcceptAlertKeyword.groovy:75)
at com.kms.katalon.core.webui.keyword.builtin.AcceptAlertKeyword$_acceptAlert_closure1.call(AcceptAlertKeyword.groovy)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.AcceptAlertKeyword.acceptAlert(AcceptAlertKeyword.groovy:71)
at com.kms.katalon.core.webui.keyword.builtin.AcceptAlertKeyword.execute(AcceptAlertKeyword.groovy:66)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.acceptAlert(WebUiBuiltInKeywords.groovy:1522)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$acceptAlert$5.call(Unknown Source)
at Script1643782115858.run(Script1643782115858.groovy:55)
… 13 more
)

1 Like

I’m going to mark this as a bug report.

@cdapitanon Can you provide the complete details?

Katalon version:
Browser and version:
Operating System:

@duyluong This is approx the fourth report like this in the last month or so. Moving to Bug Reports while you take a look. Thanks.

https://forum.katalon.com/search?q=acceptAlert%20order%3Alatest

1 Like

@Russ_Thomas

Thanks for your prompt reply, please refer below per request.
Katalon version: 8.2.0
Browser and version: Chrome Version: 98.0.4758.81
Operating System: Windows 10 64bit

Check this out, there are a couple of possible solutions, you might want to try.

1 Like

@Matthew_Loo Thanks, it works for me. :heart:

2 Likes

Unfortunately the above mentioned workaround did not correct the behavior. This issue surfaced for me after updating Chrome and Chome Driver to:
ChromeDriver 99.0.4844.51
Chrome: Version 99.0.4844.74 (Official Build) (64-bit)

Currently using Katalon Studio 8.2.5
OS is Windows 10 64 bit

Hi @rkirberger,

Do you face the same error log?

Nam Nguyen.

@nam.nguyen The error may be a little different due to version differences, however the behavior is the same. I see the popup display in the UI for 1 second or so then it dismisses without any interaction from Katalon. Below are 2 of the Alert Keywords I experienced the behavior with. I have also tested with Katalon Studio version 8.3.0 and still experiencing the same behavior.

Keyword: WebUI.verifyAlertPresent(5)
Failure Cause from Console:
Caused by: com.kms.katalon.core.exception.StepFailedException: No alert found after 5 second(s).

WebUI.acceptAlert()
Failure Cause from Console:
Caused by: com.kms.katalon.core.exception.StepFailedException: No alert found

Hi, I’m facing the same issue since last update. I haven’t find solution yet so if you have one, i’ll take it :wink: Thanks for sharing
Max

Hi everyone,

I’ve logged the bug ticket for this issue.
I’ll keep you updated when it’s fixed on any version.

Thank you all so much for your information,
Please let others know if you have any workaround.

Happy Testing!
Nam Nguyen.