Appium 2 + Robotframework : Close All Applications does not working

Hello guys!

I m working with appium 2 and robotframework.
I have notices since I use robotframework-appiumlibrary==2.0.0, the keyword “Close All Applications” doesn’t close my app
There is no error in my robotframework log like the behaviour of the keyword was ok…
I specify that my selenium grid session has been normally closed.

my settings:
windows+android11 and uiautomator2
image

my logs:
image

I didn’t have this problem with appium v1…

I really need help! Thank you by advance !

AJ

how is this causing a problem for the test case is my question though, are you ending up with browser tabs open or something? I’m suspecting it’s just that some flags have been added and you will want to look at all the logs in detail and search for changes to the capabilities. Do you install the app for every test?

Hello Conrad and thank you for your answer,
The app is already install on the smartphone

That’s the code RF:

*** Settings ***

Suite Teardown Close Test

*** Variables ***
${activity} com.example.app.MainActivity
${app} com.example.app
${deviceName} g30C

*** Test Cases ***
Go

Open Application    http://127.0.0.1:4444/wd/hub
 ...    platformName=ANDROID
 ...    appium:deviceName=${deviceName}
 ...    appium:automationName=UiAutomator2
 ...    newCommandTimeout=2500
 ...    appActivity=${activity}
 ...    appPackage=${app}
 ...    udid=${UDID}
 ...    noReset=true
Sleep    10s
Capture Page Screenshot    test.png

This is a problem because I would like the application to be closed and the mobile to be in the initial state because if I restart a test, it restarts from the screen where the test ended just before

oh, yeah i adopted the assumption that I want the app open at the end of my mobile tests, to make it easier to manually debug and see what the final state of the app is. I uninstall the app before my test starts, before I even let the appium do it’s thing. And that has worked out very well for me as a strategy, I turned off that terminate flag, and it suits my workflow. It also deals with cases where the appium server might crash and thus fail to close the app.

BUT yes, you are right, it should work. I don’t use robot (I did once ages ago) and I use the ideviceinstaller and adb libraries to sandbox my mobile app before I open the appium server. But if you do not succeed, then some code to help close the app in another script might be a solution.

I can easily use an ADB command to close my application but I really wanted to know if anyone has had this problem before as it seems to be a significant bug with Appium v2.

The KW “Close All Applications” is a basic in mobile test automation.

I hope the Appium community will take care of this issue and release a new version soon :slight_smile:

1 Like

no one else encounters this problem?

Try add capability forceAppLaunch to restart your app before test

1 Like

Honestly I don’t think there are many Robotframework users on this forum. Either they aren’t here or they are only lurkers. We get questions occasionally but not good answers. Personally I have never used it.

They do list a forum and a slack channel on their website. Have you joined those?
https://robotframework.org/#community

1 Like