appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.2k stars 753 forks source link

App do not quit .setNoReset(true) #2023

Open dipakkumar1225 opened 11 months ago

dipakkumar1225 commented 11 months ago

Description

Application do not quit, when used .setFullReset(false) and .setNoReset(true). After removing .setNoReset(true) and setting both .setFullReset(false) and .setNoReset(false) are working.

Environment

UiAutomator2Options uiAutomator2Options = new UiAutomator2Options()
        .setAutomationName(AutomationName.ANDROID_UIAUTOMATOR2)
        .setApp(configurationProperties.extractApkFilePath().getAbsolutePathToMobileApp().toString())
        .setFullReset(false)
        .setNoReset(false)
        .setPlatformName(deviceContext.getPlatformName())
        .setPlatformVersion(deviceContext.getPlatformVersion())
        .setUdid("emulator-5554")
        .setAppPackage(configurationProperties.getApkPackageName())
        .setAppActivity(configurationProperties.getApkLaunchableActivityName());

uiAutomator2Options.setCapability(AndroidMobileCapabilityType.UNICODE_KEYBOARD, true);
uiAutomator2Options.setCapability(AndroidMobileCapabilityType.RESET_KEYBOARD, true);

driver = new AndroidDriver(appiumServerManager.getAppiumServerURL(), uiAutomator2Options);
driver.setSetting(Setting.ENABLE_NOTIFICATION_LISTENER, false);
driver.setSetting(Setting.WAIT_FOR_SELECTOR_TIMEOUT, 0);
driver.setSetting(Setting.WAIT_FOR_IDLE_TIMEOUT, 0);

Please find the both the logs link

  1. When used .setNoReset(true) https://gist.github.com/dipakkumar1225/cf4d7b0525dbff5637cbc8cbce2b601a

  2. When not used .setNoReset(true) https://gist.github.com/dipakkumar1225/c6c666890c8afb030b29dfef290d601e

mykola-mokhnach commented 11 months ago

Possible duplicate of https://github.com/appium/appium/issues/16396