How to perform Multi Device Tests on Android using the Robot Framework

谁说我不能喝 提交于 2019-12-14 03:08:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!