selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[🐛 Bug]: The unhandledPromptBehavior capability is not working in Chrome Browser

Open Rabindra184 opened this issue 3 years ago • 3 comments

What happened?

Issue: The Alert prompt is not accepted automatically when I set the setUnhandledPromptBehaviour() to UnexpectedAlertBehaviour.ACCEPT in chrome.

How can we reproduce the issue?

Please run the below program to reproduce this issue

Program:
@Test
    public void test(){

        ChromeOptions options=new ChromeOptions();
        options.setUnhandledPromptBehaviour(UnexpectedAlertBehaviour.ACCEPT);
        driver=new ChromeDriver(options);
        driver.get("https://demo.guru99.com/test/delete_customer.php");
        driver.findElement(By.xpath("//input[@name='submit']")).click();
    }

Relevant log output

The alert generated is not getting accepted automatically.

Operating System

Mac OS Ventura(13.3.1 (22E261))

Selenium version

4.10.0

What are the browser(s) and version(s) where you see this issue?

Version 114.0.5735.198 (Official Build) (arm64)

What are the browser driver(s) and version(s) where you see this issue?

Using Selenium Manager to get the driver as I am using latest selenium Version

Are you using Selenium Grid?

No response

Rabindra184 avatar Jul 10 '23 02:07 Rabindra184

@Rabindra184, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

github-actions[bot] avatar Jul 10 '23 02:07 github-actions[bot]

The alert does not get accepted or dismissed automatically.

The unhandled prompt behavior is how the driver should respond when a non-alert action is taken when an alert is present. You still have to take that action (any selenium command will work) to trigger the unhandled prompt condition which will execute the specified behavior.

titusfortner avatar Jul 10 '23 02:07 titusfortner

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Dec 09 '23 00:12 github-actions[bot]