Webdriver. quit() /webdriver.close() does not work in selenium 3.141.59 | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos

Selenium Training Forum

Webdriver. quit() /webdriver.close() does not work in selenium 3.141.59

C
chaitra jagirdar Post on 04/09/2019

Sir , referred :https://github.com/SeleniumHQ/selenium/issues/6826

https://developers.perfectomobile.com/pages/viewpage.action?pageId=21432417

 

Both my browsers have same issue:

-------------------------------------------

Sir my firefox (68.0.2) with geckodriver(latest)

Chrome(76.0.3809.132 ) with chromedriver(latest)

 

Sir is there a known alternative this issue ?

 

 

 

S

Instructor

Support Team Reply on 04/09/2019

Please export your project in a zip file and share it with us.

C
chaitra jagirdar Reply on 07/09/2019

Kindly either run Test6/SuiteA.xml

Either way , only last browser instance is closed .Even after using driver.quit();

Its the same for both chrome/ff -latest drivers & i have latest supporting browsers respectively.

Selenium 3.141.59 is used.

 

Please suggest ..

S

Instructor

Support Team Reply on 19/09/2019

As I noticed your code. Please make some configuration changes immediately in your pom.xml and then try executing your project.

Change the following

<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>

to this

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

In addition to the above, move to problems tab and resolve all issues in the project.

C
chaitra jagirdar Reply on 25/09/2019

hi sir,

Resolved all the warnings and changed version from 1.7 to 1.8.

Attaching project.Yet All browser instances are not quit.

Please suggest.

S

Instructor

Support Team Reply on 09/10/2019

As I noticed in your code. You are using the wrong annotation.

@AfterMethod needs to be used instead of @AfterTest

As the @AfterTest will be executed only after the execution of all test cases. And due to this, old objects of driver are ignored.