How to open and close the application and still logged every test case? (RobotFramework/AppiumLibrary)

Viewed 1336

I'm trying to setup a Robot Framework automation with AppiumLibrary. I want to close the application and open it again every test case, but without logging in again. Actually, when I close the application, the app resets and ask me to log again. I just put the "noReset=true" capability on Open Application, but this don't solve my problem. Someone know how to do that?

***Settings***
Library     AppiumLibrary

***Keywords***
Start Session
    Set Appium Timeout  10
    Open Application    http://localhost:4723/wd/hub
    ...                 automationName=UiAutomator2
    ...                 platformName=Android
    ...                 deviceName=emulator-5554
    ...                 appPackage=br.com.app.app
    ...                 appActivity=.MainActivity
    ...                 autoGrantPermissions=true
    ...                 noReset=true
    Sleep               5

Start app
    Wait Until Page Contains               Hello

Close Session
    Capture Page Screenshot
    Close Application                      noReset=true

Close Application
    Capture Page Screenshot
    Quit Application   

Launch Application
    Open Application                     http://localhost:4723/wd/hub
    ...                                  automationName=UiAutomator2
    ...                                  platformName=Android
    ...                                  deviceName=emulator-5554
    ...                                  appPackage=br.com.app.app
    ...                                  appActivity=.MainActivity
    ...                                  autoGrantPermissions=true
    ...                                  noReset=true

***Test Cases***
See the first screen
    [Setup]          Start Session
    Start app
    Log in
    Check the first screen
    [Teardown]       Close Application

See the second screen
    [Setup]          Launch Application
    Check the first screen
    [Teardown]       Close Session
1 Answers

Try to use both fullReset=false and noReset=true in capabilities. This can solve your problem.

Related