简体   繁体   English

如何在多个设备上运行Uiautomator测试?

[英]How to run Uiautomator tests in to multiple devices?

I am trying to Uiautomator android Ui tests in a .bat file. 我试图在.bat文件中Uiautomator android Ui测试。 but i could not able them run parallelly. 但我无法让他们并行运行。

Here is my execution flow and have connected 3 devices 这是我的执行流程并连接了3个设备

-> adb devices XXXX XXXX XXXX - > adb devices XXXX XXXX XXXX

-> adb push ./bin/UiautomatorTests.jar /data/local/tmp/ - > adb push ./bin/UiautomatorTests.jar /data/local/tmp/

-> adb shell uiautomator runtest UiautomatorTests.jar -c com.music.tests - > adb shell uiautomator runtest UiautomatorTests.jar -c com.music.tests

Here how can i give a common common command for all the devices to runs with parllely 在这里,我如何为所有设备提供一个共同的通用命令来运行parllely

You can well use 你可以使用

adb -s <device_id> push ./bin/UiautomatorTests.jar /data/local/tmp/
adb -s <device_id> shell uiautomator runtest UiautomatorTests.jar -c com.music.tests

Using above commands, you can run 3 parallel instances of your automation changing <device id> appropriately 使用上述命令,您可以运行自动更改<device id> 3个并行实例

You can find your <device id> from adb devices 您可以从adb devices找到<device id>

Good luck !! 祝好运 !!

You can checkout Uiautomator-bot as it seems to fit your requirement. 您可以结帐Uiautomator-bot,因为它似乎符合您的要求。 It can run UIautomator test cases simultaneously on all connected devices. 它可以在所有连接的设备上同时运行UIautomator测试用例。 For further info check this link . 有关详细信息,请查看此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM