Seleium 2.0 WebDriver
I have the following code that clicks on a link to open a .csv file. According to the docs WebDriver should allow me to dismiss or accept this pop up as an alert.
Here is the code:
WebElement element =
driver.findElement(By.linkText("open csv file"));
// Here I see the Open Dialog of my .csv file
Alert alert = driver.switchTo().alert();
// this fails with NoAlertPresentExcption
I'm sure I'm doing something wrong - but it seems my pop up dialog is not being recognized as an Alert.
Any suggestions would be greatly appreciated
Try to get the hwnd or name of the dialog box and then use
WebDriver window = driver.switchTo().window(sWindowName);
Winds of Change
Lukasz Morawski, QA Engineer
Cognifide testing blog
Ok i was not aware of this, thanks.