error communicating with the remote browser. it may have died. [Solved]

error communicating with the remote browser. it may have died.

This usually happens when you are trying to close the same webdriver instance multiple times. Do you know what happens in super.teardown()?When I checked the selenium4j source, it extends junit Testcase. Your super.tearDown will be calling jUnitTeardown and would be killing the browser instance before closeSeleniumSession() is called.

You can put that closeSeleniumSession() before super.tearDown().

if(driver != null) {
driver.close();
driver.quit();
}

Similar Posts: