一旦该应用程序在多个安卓设备上启动,就可以使用enter image description here。我们如何在多个移动设备上同时执行相同的测试用例?因为我有一堆测试用例要在多个android设备上执行。我试图通过在测试用例中传递udid或Appium服务器名称来使用For循环,但它不是working.It在单个设备only.Is上执行测试用例有什么方法可以让我们同时在多个安卓设备上执行测试用例(相同的测试用例/测试套件)?
发布于 2018-01-16 15:14:27
您可以使用带有--argumentfileNUMBER选项的https://github.com/mkorpela/pabot。
发布于 2018-01-16 17:09:52
你基本上想要做的是测试的并行执行。有许多工具可以轻松地实现这一点,并且覆盖范围很广(大量的设备和风格),如AWS云、Xamarin测试云、SeeTest设备场、Perfecto等
但是,如果你想使用Appium和TestNG来实现,这仍然是可能的。以下是高级步骤:
以下是带有确切命令和步骤的链接:http://toolsqa.com/mobile-automation/appium/appium-parallel-execution-using-testng/
发布于 2018-01-18 16:27:49
你可以使用下面这样的方法来解决你的问题。正如我在前面的回答中所说的,您可以将驱动程序保存在字典&{drivers}中,并在循环中使用它在所有设备上执行重复操作。
*** Settings ***
Library AppiumLibrary
Library Collections
Library Process
*** Variables ***
${APPIUM_SERVER1} http://127.0.0.1:4723/wd/hub
${APPIUM_SERVER2} http://127.0.0.1:4750/wd/hub
${udid_device1} udid of device 1
${udid_device2} udid of device 2
*** Keywords ***
setup and open android phone A
&{drivers}= Create Dictionary
${androiddriver1}= Open Application ${APPIUM_SERVER1} platformName=android platformVersion=7.0 deviceName=android udid=${udid_device1} automationName=uiautomator2
... appPackage=com.android.contacts newCommandTimeout=2500 appActivity=com.android.contacts.activities.PeopleActivity
Set To Dictionary ${drivers} ${udid_device1}=${androiddriver1}
Set suite variable ${drivers}
setup and open android phone B
${androiddriver2}= Open Application ${APPIUM_SERVER2} platformName=android platformVersion=7.0 deviceName=android udid=${udid_device2} automationName=uiautomator2
... appPackage=com.htc.contacts newCommandTimeout=2500 noReset=True appActivity=com.htc.contacts.BrowseLayerCarouselActivity
Set To Dictionary ${drivers} ${udid_device2}=${androiddriver2}
Set suite variable ${drivers}
Log Dictionary ${drivers}
Open URL
:FOR ${key} IN @{drivers.keys()}
\ ${value}= Get From Dictionary ${drivers} ${key}
\ Log ${key}, ${value}
\ repetitive actions herehttps://stackoverflow.com/questions/48275593
复制相似问题