Multiple devices connected error in Robotframework

此生再无相见时 提交于 2019-12-06 14:48:49

问题


I am using Robot Framework with UI-Automator for automating Native Android application. In my current instance I have connected two devices to my PC- one for my general testing work and in the second device, I am running Automation. I have given serial of the device while running the test cases.

But I am getting following error in the console:

EnvironmentError: Multiple devices attached but default android serial not set

can somebody help me what I need to do.


回答1:


The answer is on the documentation for the Set Serial keyword, on uiautomatorlibrary.html, below:

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 |



来源:https://stackoverflow.com/questions/40859752/multiple-devices-connected-error-in-robotframework

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