Driver.close() vs driver.quit

Hi,

I was wondering what a difference between driver.close to driver.quit

Thanks

from javadoc

/**

  • Close the current window, quitting the browser if it’s the last window currently open.
    */
    void close();

/**

  • Quits this driver, closing every associated window.
    */
    void quit();

so in terms of appium -
close closes the app but keeps the driver instance.
quit terminates the driver instance.

1 Like

great, thanks

where did you find the java docs?
in java_client doc file i couldn’t find it
http://appium.github.io/java-client/

It’s in the selenium javadoc.

1 Like

so far i’ve seen driver.close() is not supported on appium.
Do you know if is there a way to close browser and continue interaction with device?

For Android tests, you can use AndroidDriver.pressKeyCode to send an AndroidKeyCode.HOME value to Appium, which should simulate the user pressing the home button on the Android device. I do not think this feature is supported for iOS devices, as iOS tests are restricted by the iOS system to only operate within the application under test (might change with the new iOS automation framework, but I have no experience with the new system).

1 Like