You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.
What steps will reproduce the problem?
1. Use this test case:
@Test
public void testPopupClose() {
WebDriver driver = new FirefoxDriver();
driver.get( "http://lucastheisen.com/test/lucas_test_page.html" );
driver.findElement( By.id( "popup_link" ) ).click();
String mainWindowHandle = driver.getWindowHandle();
System.out.println( "currentWindowHandle='" + mainWindowHandle + "'" );
boolean foundPopup = false;
for ( String windowHandle : driver.getWindowHandles() ) {
if ( !windowHandle.equals( mainWindowHandle ) ) {
System.out.println( "checking '" + windowHandle + "' for taunt" );
driver.switchTo().window( windowHandle );
try {
driver.findElement( By.id( "taunt" ) );
foundPopup = true;
break;
}
catch ( NoSuchElementException e ) {
System.out.println( "'" + windowHandle + "' is not taunt window"
);
}
finally {
if ( !foundPopup ) {
driver.switchTo().window( mainWindowHandle );
}
}
}
}
if ( foundPopup ) {
System.out.println( "found my popup, now try to close it..." );
driver.close();
}
//****************************************
System.out.println( "SET BREAKPOINT ON THIS LINE" );
//****************************************
driver.switchTo().window( mainWindowHandle );
driver.findElement( By.id( "popup_link" ) );
driver.close();
assertTrue( true );
}
2. Set a breakpoint on the indicated line.
3. Run the test case with the debugger.
What is the expected output? What do you see instead?
I would expect to be able to step through this code with no problem. Instead, if the
debugger is stopped between the driver.close() on the popup window and the driver.switchTo().window(
mainWindowHandle ), I get this:
org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException:
Connection to http://127.0.0.1:7056 refused
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version:
'1.6.0_24'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:407)
What version of the product are you using? On what operating system?
I am using this:
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.0b2</version>
<type>jar</type>
<scope>test</scope>
</dependency>
My operating system is 64 bit Windows 7 Ultimate.
Please provide any additional information below.
Reported by lucastheisen on 2011-03-09 19:32:01
The text was updated successfully, but these errors were encountered:
Originally reported on Google Code with ID 1378
Reported by
lucastheisen
on 2011-03-09 19:32:01The text was updated successfully, but these errors were encountered: