Skip to content

Instantly share code, notes, and snippets.

@krmahadevan
Created November 29, 2011 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krmahadevan/1404611 to your computer and use it in GitHub Desktop.
Save krmahadevan/1404611 to your computer and use it in GitHub Desktop.
This is the main html page that is to be loaded
<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>
<html>
<body>
<form>
<input type="button" name="close_window" value="Return to Log"/>
</form>
</body>
</html>
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();
}
}
@krmahadevan
Copy link
Author

Output is seen as below:

  • I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed
  • Retrying request
    1

@krmahadevan
Copy link
Author

Version :

IE : 8
Windows 7
using java bindings and Selenium 2.12.0 (2.13.0 also seems to have the same problem)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment