如何使用机器人框架在 Android 上执行多设备测试 [英] How to perform Multi Device Tests on Android using the Robot Framework

查看:59
本文介绍了如何使用机器人框架在 Android 上执行多设备测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用带有 Appium 的 Robot Framework 在多个移动设备(模拟器)上启动我的应用.

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}

请帮助我使用 Robot Framwork-Appium 进行多设备测试

Please help me on Multi device testing using Robot Framwork-Appium

推荐答案

问题格式不正确,我正在粘贴将在两台设备上启动应用程序的示例代码,您可以从这里参考

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}

这篇关于如何使用机器人框架在 Android 上执行多设备测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆