Selenium - there is a modal dialogue - how to receive information?

I have the following problem. After sending any date on the page, I have a modal dialog, as in the picture:

enter image description here

I want to press "ENTER" to go through this modal, but it does not work. I have the following code:

driver.FindElement(By.CssSelector("input.submit")).Click();
Actions action = new Actions(driver);
action.SendKeys(OpenQA.Selenium.Keys.Enter);

After you click continue the test manually, return to the next page. I have to go through this method to continue the test. Any ideas how to solve this problem?

+4
source share
2 answers

I found a solution using the following code:

IAlert alert = driver.SwitchTo().Alert();
alert.Accept();

This works for me.

+9
source

In java:

Alert alert = m_driver.switchTo().alert(); 
alert.accept();
+1
source

All Articles