Issue 1632 in selenium: IEDriver close() broken, prevents creation of new instace of the IEDriver, HttpHostConnectException thrown

2 views
Skip to first unread message

sele...@googlecode.com

unread,
May 6, 2011, 5:39:26 PM5/6/11
to selenium-deve...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1632 by Stam...@gmail.com: IEDriver close() broken, prevents
creation of new instace of the IEDriver, HttpHostConnectException thrown
http://code.google.com/p/selenium/issues/detail?id=1632

What steps will reproduce the problem?
Run this Junit4 class:

public class TwoIeDriverInstancesTest {

WebDriver driver;

@Before
public void setUp(){
driver = new InternetExplorerDriver();
}

@Test
public void firstInstance(){
driver.get("www.google.com");
}

@Test
public void secondInstance(){
driver.get("www.yahoo.com");
}

@After
public void tearDown(){
driver.close();
}
}


What is the expected output? What do you see instead?
What I expect is both tests to pass.

However, the second test fails with the following exception :

org.openqa.selenium.WebDriverException:
org.apache.http.conn.HttpHostConnectException: Connection to
http://localhost:27575 refused
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1',
java.version: '1.6.0_23'
Driver info: driver.version: InternetExplorerDriver
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:406)
at
org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:103)
at
org.openqa.selenium.ie.InternetExplorerDriver.setup(InternetExplorerDriver.java:99)
at
org.openqa.selenium.ie.InternetExplorerDriver.<init>(InternetExplorerDriver.java:56)
at
yuri.exp.testing.selenium.test.TwoIeDriverInstancesTest.setUp(TwoIeDriverInstancesTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:97)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:192)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: org.apache.http.conn.HttpHostConnectException: Connection to
http://localhost:27575 refused
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:159)
at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
at
org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:272)
at
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:252)
at
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:389)
... 30 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at
org.openqa.selenium.remote.ReusingSocketSocketFactory.connectSocket(ReusingSocketSocketFactory.java:122)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:133)
... 37 more


java.lang.NullPointerException
at
yuri.exp.testing.selenium.test.TwoIeDriverInstancesTest.tearDown(TwoIeDriverInstancesTest.java:42)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:97)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:192)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)

Process finished with exit code -1


What version of the product are you using? On what operating system?
I'm using the latest version available from the repository, at the writing
of this text :
Rev: 12138
Last Changed Date: 2011-05-06 20:28:21 +0300 (Fri, 06 May 2011)

I'm using Win7 x64 SP1 and Java 1.6.0_023

Please provide any additional information below.

It will work if I use driver.quit() instead of close(), so a simple
workaround exists. This is very similar to Issue 1444, but obviously not
fixed.


sele...@googlecode.com

unread,
May 7, 2011, 2:34:29 AM5/7/11
to selenium-deve...@googlegroups.com

Comment #1 on issue 1632 by Stam...@gmail.com: IEDriver close() broken,
prevents creation of new instace of the IEDriver, HttpHostConnectException
thrown
http://code.google.com/p/selenium/issues/detail?id=1632

Also, I forgot to mention I'm using IE9.

Reply all
Reply to author
Forward
0 new messages