问题
I am trying to launch my app on multiple mobile devices (emulators) using Robot Framework with Appium.
I am using below keyword in different test cases.But still its launching app on one device only which comes first in the connected list :
${appium1}= Open Application
... http://localhost:4723/wd/hub
... platformName=${PLATFORM_NAME}
... platformVersion=${PLATFORM_VERSION}
... deviceName= emulator-5556
... appPackage=${appPackage}
... appActivity=${appActivity}
${appium2}= Open Application
... http://localhost:4725/wd/hub
... platformName=${PLATFORM_NAME}
... platformVersion=${PLATFORM_VERSION}
... deviceName=emulator-5554
... appPackage=${appPackage}
... appActivity=${appActivity}
Please help me on Multi device testing using Robot Framwork-Appium
回答1:
question is not properly formatted , i am pasting sample code which will launch the app on two devices , you can take reference from here
*** Settings ***
Documentation This script starts apps on two phones
Library AppiumLibrary
Library Collections
*** Variables ***
${APPIUM_SERVER1} http://0.0.0.0:4723/wd/hub
${APPIUM_SERVER2} http://0.0.0.0:4750/wd/hub
*** Test cases ***
Test
setup and open android phone1
setup and open android phone2
*** Keywords ***
setup and open android phone1
${androiddriver1}= Open Application ${APPIUM_SERVER1} platformName=android platformVersion=7.0 deviceName=f1232233 automationName=uiautomator2
... appPackage=com.samsung.android.contacts newCommandTimeout=2500 appActivity=com.android.dialer.DialtactsActivity
Set Suite Variable ${androiddriver1}
setup and open android phone2
${androiddriver2}= Open Application ${APPIUM_SERVER2} platformName=android platformVersion=7.0 deviceName=s12333 automationName=uiautomator2
... appPackage=com.samsung.android.contacts newCommandTimeout=2500 appActivity=com.android.dialer.DialtactsActivity noReset=True
Set Suite Variable ${androiddriver2}
来源:https://stackoverflow.com/questions/48167276/how-to-perform-multi-device-tests-on-android-using-the-robot-framework