How to close application between tests?

When I am using $driver.close_app method, it closes application and crashes all tests running session. I need to close app and open it again between tests.

driver.quit works well in my case. I launch app in @BeforeMethod and close it in @AfterMethod and all test cases cases execute without any exception.

If I use quit after each test case, I am getting next error:


It basically terminates driver

Java client has several methods that may be of use:

Thanks. I know about these methods. Closing app method crashes my tests.

Same problem in my caseā€¦Error (Selenium::WebDriver::Error::NoSuchDriverError) while using driver_quit in my ruby script.

Resolve this error by using :
:slight_smile: :smile:

You could surround driver.quit by try-catch block :slight_smile:

Not a great solution to quit the driver. Locally, fine. Remote, more expensive connections this is just wrong. I messed with this a bit, and now driver.close_app() and driver.launch_app() appear to work for me without tearing down the driver connection. (python)