Though it looks like an alert to you, WebDriver may not identify it as an alert. Do one thing..try to locate that alert with firebug inspect tool and look for the 'id' of the OK button, then handle it with javascript.
like,,,
document.getElementById("alt-OK").click();
On Wed, Aug 15, 2012 at 12:30 PM, Popsha
<pop...@gmail.com> wrote:
Having a drop down list of different countries.
Selecting a particular country would pop up an alert message with ok button.
After clicking ok button focus is still in the drop down box, then i should move next web element and so on...
Problem is that, I could not get focus on the alert message as it throws 'NoAlertPresentException'
My code is below:
try{
new Select(driver.findElement(By.name("country"))).selectByVisibleText("abcd");
Thread.sleep(2000L);
Alert alt = driver.switchTo().alert();
Thread.sleep(5000L);
alt.accept();
}catch (Exception e){e.printStackTrace();}
Please suggest me a solution for this.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/fWGCHC1Bxw4J.
For more options, visit https://groups.google.com/groups/opt_out.
--
Thanks&Regards
Anjaneyulu P
"The way you see the things is the way to think and is the way you react upon!!"