Activities
latest
false
Banner background image
UI Automation Activities
Last updated Apr 26, 2024

PREVIEW
Connection

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.

To create a connection, you need to have a device and an application configured. The Mobile Automation service exposes APIs dedicated to creating and configuring devices or applications.

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.

Creating a connection

  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. Create a variable using the var keyword. For instance, 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. With the variable now set up, use this to call the necessary APIs and automate your mobile testing scenarios.
    connection.Tap()connection.Tap()
  • Creating a connection

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.