activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

用户界面自动化活动

上次更新日期 2025年8月27日

连接

A Connection is a class that represents the connection that you create between a device and an application, using the Connect/ ConnectAsync APIs. This is the class that exposes all the APIs that you can use to automate mobile testing scenarios.

要创建连接,您需要配置设备和应用程序。 移动自动化服务公开了专用于创建和配置设备或应用程序的 API。

For example, to create and configure a device you can use the following APIs and their corresponding classes: CreateDevice, GetDevice, GetDevices, while for applications you can use the following APIs: CreateApplication, GetApplication, GetApplications.

创建连接

  1. Configure a device and an application. You can either do this directly in the code using CreateDevice and CreateApplication APIs, or within Mobile Device Manager.
  2. 使用var关键字创建变量。 例如var connection
  3. Invoke the mobile service on this variable using the Connect/ ConnectAsync API, and provide the device and application configured in the previous step as parameters:
    var connection = mobile.Connect(device, application)var connection = mobile.Connect(device, application)
    Remember, you can also use Connect/ConnectAsync with the device and application names configured in Mobile Device Manager:
    var connection = mobile.Connect("<deviceName>", "<applicationName>")var connection = mobile.Connect("<deviceName>", "<applicationName>")
  4. 现在设置变量后,请使用此变量来调用必要的 API 并自动化移动测试场景。
    connection.Tap()connection.Tap()
  • 创建连接

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。