Selenium driver.SwitchTo().Alert().Accept() is not working

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Selenium driver.SwitchTo().Alert().Accept() is not working

Postby Shay » Sun Dec 27, 2020 7:10 am

Hello,

I need to use Selenium to accept the JS alerts on CefSharp.
I notice that after sending the accept (driver.SwitchTo().Alert().Accept()) , the alert dialog is not closed.
The problem is not reproduced on Chrome.

I tried to check JsDialogHandler but I didn't find a solution.
I also tried to check it with CefSharp.MinimalExample (https://github.com/cefsharp/CefSharp.MinimalExample).

Here is my code:

IWebDriver driver = new ChromeDriver(cds, options);

var alert_win = driver.SwitchTo().Alert();
//Assert.AreEqual(expectedAlertText, alert_win.Text);
Thread.Sleep(100);
alert_win.Accept();

Please help,

Thanks
Shay
Newbie
 
Posts: 9
Joined: Fri Dec 04, 2020 9:25 am

Re: Selenium driver.SwitchTo().Alert().Accept() is not worki

Postby magreenblatt » Sun Dec 27, 2020 11:40 am

magreenblatt
Site Admin
 
Posts: 12407
Joined: Fri May 29, 2009 6:57 pm

Re: Selenium driver.SwitchTo().Alert().Accept() is not worki

Postby Shay » Sun Dec 27, 2020 1:03 pm

Thinks, But this issue is from 2013 CEF3 version: cef_binary_3.1547.1412_windows32
Wasn't it fixed since then?

Thanks,
Shay
Shay
Newbie
 
Posts: 9
Joined: Fri Dec 04, 2020 9:25 am

Re: Selenium driver.SwitchTo().Alert().Accept() is not worki

Postby Czarek » Mon Jan 04, 2021 1:37 pm

The status of the issue is "New" meaning it wasn't fixed (low priority).
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 50 guests