Selenium Webdriver throws exception "org.openqa.selenium.remote.UnreachableBrowserException" on the use of quit() method

1,318 views
Skip to first unread message

www.automation.lifegoeasy.com

unread,
May 2, 2013, 2:26:58 AM5/2/13
to webd...@googlegroups.com
My code -
    1.        driver = new InternetExplorerDriver();
    2.        driver.get("url...");
    3.        driver.quit();
    4.        driver.close();
    5.        driver = new InternetExplorerDriver();
    6.        driver.get("url...");

first 4 line works fine, Eclipse throws below error on 5th line & browser is not started.

Error Message =
    org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
    Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:08:56'
    System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_21'
     Driver info: driver.version: RemoteWebDriver

Maxim Vorobev

unread,
May 2, 2013, 2:38:05 AM5/2/13
to webd...@googlegroups.com

Show full stacktrace. I'll bet you get exception on 4th line, cuz


Quits this driver, closing every associated window.




--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Krishnan Mahadevan

unread,
May 2, 2013, 2:38:14 AM5/2/13
to webdriver
I believe you should first do a driver.close() and then do a driver.quit()

Try changing the order of (3) and (4) and see if that helps

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/


www.automation.lifegoeasy.com

unread,
May 2, 2013, 4:16:11 AM5/2/13
to webd...@googlegroups.com
I commented quit() method, exception is not thrown but browser is getting closed at the end of execution. I changed the order of quit() & close method, it still throws same error.

Maxim Vorobev

unread,
May 2, 2013, 4:27:45 AM5/2/13
to webd...@googlegroups.com
Show full code and full stacktrace.

Also read about quit() and close()  semantics:


Umamaheshwar Thota

unread,
May 2, 2013, 9:47:42 AM5/2/13
to webd...@googlegroups.com
Actually the error is on 4th line only and definitely it will be on line 4 because the error will be displayed on the next line where it hasn't find the required code to execute on screen.

Both the line 3 and 4 are similar. remove any one and execute.

cheers,
Umamaheshwar Thota


On Thursday, May 2, 2013 11:56:58 AM UTC+5:30, www.automation.lifegoeasy.com wrote:

Mark Collin

unread,
May 3, 2013, 8:27:13 AM5/3/13
to webd...@googlegroups.com
A quit will perform a close.

Trying to close a browser that has already been closed will cause an error.

If you really want to quit don't close, just quit. Close is really
designed to close one browser window when you have multiple windows open.
Reply all
Reply to author
Forward
0 new messages