Reputation: 728
Here is the log
Test Andriod Demo :: App for appium library
OpenApplication1
| PASS | OpenApplication2
| FAIL | URLError: SwitchApplication1
| FAIL | Variable '${browser}' not found.
Here is the Test case
OpenApplication1
${browser} Open Application http://localhost:4723/wd/hub platformName=Android platformVersion=4.2.2 deviceName=192.168.56.101:5555 app=${CURDIR}/demoapp/Browser.apk automationName=appium appPackage=com.app.robot appActivity=MainActivity
OpenApplication2
${app} Open Application http://localhost:4725/wd/hub platformName=Android platformVersion=4.2.2 deviceName=192.168.56.101:5555 app=${CURDIR}/demoapp/QA.apk automationName=appium appPackage=com.app.test appActivity=LoginActivity
SwitchApplication1
Switch Application ${browser}
Sincerely looking for an answer
Upvotes: 2
Views: 1792
Reputation: 32280
While the first application is running you can launch second application but you have to kill the second application to come back where you left off in the first application
OpenApplication2
./adb shell monkey -p com.test.t1 -c android.intent.category.LAUNCHER 1
CloseApplication2
./adb shell am force-stop com.test.t1
FYI:
use the keyword execute
to run adb
Upvotes: 1
Reputation: 305
A workaround worked for me. Try this.
OpenApplication1
OpenApplication2
Switch Application ${browser}
Background App 5
After last keyword, it will switch to Application1
Upvotes: 0
Reputation: 822
I also have tried like you But Switch application is not implemented as of now in Appium for Robot Framework
Upvotes: 0
Reputation: 3095
I solved the problem by closing the first application and opening the second application.
use this below command
OpenApplication1
do some activities with that then close the application
Close Application
OpenApplication2
Upvotes: 2