gpt4 book ai didi

android - Robotframework 中的多个设备连接错误

转载 作者:行者123 更新时间:2023-11-29 19:28:19 25 4
gpt4 key购买 nike

我正在使用带有 UI-Automator 的 Robot Framework 来自动化 native Android 应用程序。在我当前的实例中,我将两台设备连接到我的 PC - 一台用于我的一般测试工作,而在第二台设备中,我正在运行自动化。我在运行测试用例时提供了设备的序列号。

但我在控制台中收到以下错误:

EnvironmentError: Multiple devices attached but default android serial not set

谁能帮我做我需要做的事。

最佳答案

答案在关于 Set Serial 关键字的文档中,在 uiautomatorlibrary.html 上, 下面:

Set Serial android_serial

Specify given android_serial device to perform test.

You do not have to specify the device when there is only one device connects to the computer.

When you need to use multiple devices, do not use this keyword to switch between devices in test execution.

Using different library name when importing this library according to http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html?r=2.8.5.

| Setting |..Value.| ..... Value ..... | . Value . |
| Library | Mobile | WITH NAME | Mobile1 |
| Library | Mobile | WITH NAME | Mobile1 |

And set the serial to each library.
| .... Test Case .... | ........ Action ........ | ..... Argument ..... |
| Multiple Devices | Mobile1.Set Serial | device_1's serial |
| .......................... | Mobile2.Set Serial | device_2's serial |

关于android - Robotframework 中的多个设备连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40859752/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com