Search code examples
appiumrobotframeworkappium-iosappium-android

"Quit Application" will also clear app data


I'm using Robot Framework and Appium Library to test an app on Android and iOS. The problem is that when opening the app with capability noReset=False all app data is cleared between each test case. The data should only be cleared between each test suite (Open Application).

According to best practice from Appium Library you should use Quit Application / Launch Application between each test case to re-start the app.

http://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html#Launch%20Application

The problem is that on Android all information entered in the first test case is cleared when the second test case is launched. (This is only the case for Android - not a problem for iOS.)

*** Settings ***
Suite Setup       Open Application
Suite Teardown    Close Application
Test Setup        Launch Application
Test Teardown     Quit Application

*** Test Cases ***
First Test
    Input Text    Hello World

Second Test
    Page Should Contain Text    Hello World

Second Test above will work on iOS but fail on Android. Is this intended or is there some way to avoid this behaviour?

This is the code for Open Application:

self.open_application('http://10.246.121.241:4723/wd/hub',
    alias='MiniVoc',
    app='se.volvo.androidvoc',
    appActivity='se.volvo.androidvoc.ui.main.MainActivity',
    appWaitActivity='se.volvo.androidvoc.ui.certificates.CertificatesActivity',
    autoAcceptAlerts=True,
    automationName='Appium',
    deviceName='P20',
    newCommandTimeout=60,
    noReset=False,
    platformName='Android',
    platformVersion='8.0.0',
    udid='9WVDU18C2600668',
    wdaLocalPort=8101)

Solution

  • Set noReset=true, if you don't want to clear app data. For more information about reset strategy in appium check the following diagram:

    enter image description here