Created
November 29, 2011 12:13
-
-
Save krmahadevan/1404611 to your computer and use it in GitHub Desktop.
This is the main html page that is to be loaded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form> | |
<input type="button" name="clickMe" value="Go" onclick="confirm('Really?');showModalDialog('demo1.html', 'The Page says', 'dialogWidth:370px;dialogHeight:155px;status=no;help=no;border=thin;');"/> | |
</form> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form> | |
<input type="button" name="close_window" value="Return to Log"/> | |
</form> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package selenium.madlabs; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.ie.InternetExplorerDriver; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
public class HandlingModalDialogBoxes { | |
public static void main(String[] args) { | |
DesiredCapabilities c = DesiredCapabilities.internetExplorer(); | |
c.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); | |
WebDriver driver = new InternetExplorerDriver(c); | |
driver.get("C:/Users/krmahadevan/Desktop/BugShower.html"); | |
driver.findElement(By.name("clickMe")).click(); | |
driver.switchTo().alert().accept(); | |
System.out.println(driver.getWindowHandles().size()); | |
driver.quit(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version :
IE : 8
Windows 7
using java bindings and Selenium 2.12.0 (2.13.0 also seems to have the same problem)