How to close application between tests?


#1

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.


#2

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.


#3

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

   (Selenium::WebDriver::Error::NoSuchDriverError)

It basically terminates driver


#4

Java client has several methods that may be of use:
resetApp()
closeApp()
runAppInBackground()
removeApp()


#5

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


#6

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


#7

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


#8

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