driver.quit() does not close opera browser

167 views
Skip to first unread message

Kunal Das

unread,
Nov 3, 2015, 2:36:01 AM11/3/15
to Selenium Users, Sayanta Basu, Partha Dhara, Sabyasachi Sengupta
Hi I am using opera chromium driver .22 version and latest version 33 of Opera.I am creating the driver in the following way
System.setProperty("webdriver.opera.driver", OPERA_DRIVER_PATH);
WebDriver driver = new OperaDriver();
driver.get(url);
//invoke javascript passing json object
Object response = ((JavascriptExecutor) driver).executeAsyncScript(
      "exportImg("+str+",arguments[arguments.length - 1]);" );

Finally I quit the driver after calling invokeJavascript as above with different json objects multiple number of times(in thousands)
driver.close();

The above code does not work because the Opera browser does not close.
What am I doing wrong?

Krishnan Mahadevan

unread,
Nov 3, 2015, 2:49:22 AM11/3/15
to Selenium Users
Kunal,
Without knowing a lot of the specifics behind what your complete code looks like, may I suggest that you please try using "driver.quit()" instead of driver.close()

The only time when driver.close() is expected to close a browser is when there is just 1 browser window that was spawned.

driver.quit() on the other hand is the correct way of ending a test session.

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/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/2c1c8569-0251-4a16-b302-a9c274e222ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages