1

When I am trying to driver.close() then I can get:

java.net.SocketException: Connection reset exception.

How to resolve it?

I'm writting a code like this:

driver.findElement(By.xpath("//*[text()='Log Out']")).click();
driver.close();
2
  • 1
    Please share the full error trace. Commented Nov 11, 2021 at 6:23
  • please check that you have strong internet connection Commented Nov 11, 2021 at 10:35

2 Answers 2

1

You have version problems

  1. Check your chromedriver version
  2. Check your chrome version
  3. Check your selenium version

They all should be compatible with each other

For example, if you are using chrome browser version 'Version 95.0.4638.69' you should have the same version for chromedriver.

Sign up to request clarification or add additional context in comments.

Comments

0

To get rid of the residual chores generated during the test execution and interfere in your next test execution, instead of driver.close() always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.