Issue 3482 in selenium: quit method of IEDriver makes all active instances unusable

4 views
Skip to first unread message

sele...@googlecode.com

unread,
Mar 2, 2012, 7:56:09 AM3/2/12
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3482 by wladimir...@gmail.com: quit method of IEDriver makes all
active instances unusable
http://code.google.com/p/selenium/issues/detail?id=3482

Sample code:
#!/sbin/python
hub = 'http://127.0.0.1:4444/wd/hub'
from selenium import webdriver
from selenium.webdriver import DesiredCapabilities
ie_caps = DesiredCapabilities.INTERNETEXPLORER
br1 = webdriver.Remote(hub, desired_capabilities = ie_caps)
br2 = webdriver.Remote(hub, desired_capabilities = ie_caps)
br1.get('http://ya.ru')
br2.get('http://google.ru')
br1.quit()
br2.get('http://yandex.ru')

What is the expected output?
Browser with "http://yandex.ru" page

What do you see instead?
* Browser with "http://google.ru" page
* Stacktrace:
Traceback (most recent call last):
File "/home/orlov/untitled3.py", line 17, in <module>
br2.get('http://yandex.ru')

File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
line 165, in get
self.execute(Command.GET, {'url': url})

File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
line 153, in execute
self.error_handler.check_response(response)

File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py",
line 147, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: u'Connection
refused: connect' ; Screenshot: available via screen ; Stacktrace: Method
waitForConnect threw an error in None

I have attached a patch, which fixes the problem.

Selenium version: 2.19
OS: Windows 7
Browser: Internet Explorer
Browser version: 9

Attachments:
ie_server.patch 4.0 KB

sele...@googlecode.com

unread,
Mar 2, 2012, 9:26:58 AM3/2/12
to selenium-develope...@googlegroups.com

Comment #1 on issue 3482 by james.h....@gmail.com: quit method of IEDriver

Your patch is incomplete. By changing the signatures of the C++ code,
you're changing the contract every other language binding expects the
native code to provide, and thus will break Python, Ruby and .NET. The root
cause of the problem is that the Java language bindings have not been
implemented to support multiple instances of the IE driver. A better
approach might be to mimic what the .NET bindings do in this instance.
Better still, you could provide a patch for the Java bindings to use the IE
driver standalone server. Again, see the .NET bindings for examples of how
to implement this.

sele...@googlecode.com

unread,
Mar 2, 2012, 9:31:07 AM3/2/12
to selenium-develope...@googlegroups.com

Comment #2 on issue 3482 by james.h....@gmail.com: quit method of IEDriver

Thanks very much for the patch, but it's a little incomplete. By changing
the signatures of the entry points exposed by the C++ code, you're changing
the contract that every other language binding expects the native code to

provide, and thus will break Python, Ruby and .NET. The root cause of the
problem is that the Java language bindings have not been implemented to
support multiple instances of the IE driver. A better approach might be to

mimic what the .NET bindings do in this instance, as they support multiple
instances without modification of the native code. Better still, you could

sele...@googlecode.com

unread,
Mar 5, 2012, 2:01:57 AM3/5/12
to selenium-develope...@googlegroups.com

Comment #3 on issue 3482 by wladimir...@gmail.com: quit method of IEDriver

You say, that

I don't see why java bindings can't support multiple instances of IE
driver -- the changes are simple and seem obvious to me (see patch).
In my tests it works stable with tens of instances (via RemoteDriver).
Am I missing something?

I can add patch for python bindings as well.

sele...@googlecode.com

unread,
Mar 5, 2012, 6:37:41 AM3/5/12
to selenium-develope...@googlegroups.com

Comment #4 on issue 3482 by james.h....@gmail.com: quit method of IEDriver

For those reading this issue via the tracker on the web and confused by
comment 3, I deleted both of my earlier comments because I thought better
of the content. The reporter is following the issue via email, and those
comments were inadvertently sent to them.

I have two issues with your patch. First, it breaks the interface contract
for other language bindings. I'm not comfortable forcing the other
langugage bindings to make such a disruptive change when they already
support multiple instances of IE. Which leads me to my second issue, which
is that the C++ component of the IE driver already supports multiple
sessions, without requiring a breaking change to the interface described by
the C++ code.

There are ways to have the Java bindings support multiple instances of IE
without changing the IE driver native code. You can examine the code in
either the .NET or the Ruby bindings for an example of how to accomplish
this. A much better approach would be to migrate all of the language
bindings to use the standalone IE driver server, which will make it work
much more like the Chrome driver. Again, the .NET bindings have sample code
that shows how to implement this, and do so in a way that is not
immediately breaking of existing code.

The issue tracker is not going to be the best place to have a meaningful
back-and-forth conversation about this issue. I would invite you to move
this discussion to the developers mailing list or to the IRC channel
(#selenium on Freenode).

sele...@googlecode.com

unread,
May 11, 2012, 1:57:40 AM5/11/12
to selenium-develope...@googlegroups.com
Updates:
Labels: Component-WebDriver Browser-IE

Comment #5 on issue 3482 by barancev: quit method of IEDriver makes all
(No comment was entered for this change.)

sele...@googlecode.com

unread,
May 29, 2012, 4:44:41 PM5/29/12
to selenium-develope...@googlegroups.com
Updates:
Status: Fixed

Comment #6 on issue 3482 by barancev: quit method of IEDriver makes all
Should be fixed in 2.22, as long as you're using the standalone
IEDriverServer.exe

Reply all
Reply to author
Forward
0 new messages