# Creating mobile automation workflows

> Create workflows to automate native and mobile web applications through Studio and Mobile Device Manager.

Create workflows to automate native and mobile web applications through Studio and Mobile Device Manager.

## Prerequisites

* Studio license.
* UiPath.MobileAutomation.Activities. For more
  information, see [Managing Packages](https://docs.uipath.com/studio/standalone/latest/user-guide/managing-activities-packages#managing-packages). Alternatively, you
  can use the Mobile Testing Project default
  template, as this will install the activity
  package for you.
* Device farm.
* Appium server. For more information, see [Prepare The Test Automation Framework](https://docs.uipath.com/activities/other/latest/ui-automation/mobile-device-automation-getting-started#getting-started).
* Configured device and applications. For more information, see [Managing Devices](https://docs.uipath.com/activities/other/latest/ui-automation/device-configuration) and [Managing Applications](https://docs.uipath.com/activities/other/latest/ui-automation/application-configuration#managing-applications), respectively.

## Mobile Automation Conditions

* Run-time is possible without Mobile Device Manager, whereas design-time is not. This means that you can design your workflows
  in Studio if you open Mobile Device Manager. In contrast, you can execute your tests without having to open Mobile Device
  Manager.
* The settings that you configure when you set up device and applications are applied globally. For example, if you set up a
  device and turn off Close Similar Tabs, it is going to be reflected in Studio when you create your workflow. More precisely,
  if you use the Mobile Device Connection to connect to this device, the Close Similar Tab property will inherit your configuration
  to `False`.

## Create workflow using recorded actions

Create a workflow in Mobile Device Manager by indicating your actions on-screen and recording the steps. After finishing recording
your actions, you can import the whole set in Studio.

1. Open Mobile Device Manager and start an application. For more information, see [Starting an Application](https://docs.uipath.com/activities/other/latest/ui-automation/device-interaction#device-interaction).
2. Open the **Recorded Actions** panel on the right side to keep track of your executed actions.
3. On the right side of the mobile device emulator, choose an individual or multiple actions from the **Action Bar** or interact with the device manually. For more information, see [Device Interaction](https://docs.uipath.com/activities/other/latest/ui-automation/device-interaction#device-interaction).

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-125378-cd9f412c.webp)
4. Open Studio and select **Do** within a sequence.
5. Navigate to **Mobile Automation** > **Import Recorded Actions** to add them to the sequence.
   Previously recorded actions in MDM are now part of your Studio workflow.

You can run your workflow as any other standard workflow by clicking **Run File**.

A new connection is established to the emulated mobile device to execute your actions in real-time.

## Create workflow using Studio

To understand how to create a workflow in Studio, consider the following scenarios on how to build workflows for:

* [Web
  Automation](https://docs.uipath.com/activities/other/latest/ui-automation/creating-a-mobile-automation-workflow#web-automation)
* [Native Application
  Automation](https://docs.uipath.com/activities/other/latest/ui-automation/creating-a-mobile-automation-workflow#native-application-automation)Tip: [Add Mobile Automation activities to your
  Object Repository](https://docs.uipath.com/studio/standalone/latest/user-guide/creating-an-object-repository).

### Web Automation

In this scenario, you can build an Android web automation workflow to open the documentation page
from UiPath®. Before getting started, have a
look at the [prerequisites](https://docs.uipath.com/activities/other/latest/ui-automation/creating-a-mobile-automation-workflow#creating-mobile-automation-workflows). For this specific
example, you need to configure a with
`https://www.uipath.com/` as a starting page.

1. Open Studio.
2. Select a **Mobile Testing Project** from the default templates.
3. Configure project details, select **C#/VB**, and then click **Create**.
4. Create a new test case and add a Sequence to your workflow.
5. Add a **Mobile Device Connection** activity within the sequence.
6. Click **Select Connection Details** and set your device and web application.
7. Add a **Manage Current App** activity, and from the **Command** dropdown, choose **Launch**.
8. Add a **Open URL** activity, and in the **Url** property field, pass `"https://www.uipath.com/"`.
9. Open Mobile Device Manager and [start a web application](https://docs.uipath.com/activities/other/latest/ui-automation/device-interaction#device-interaction).
10. Add a **Tap** activity, click **Indicate Target** and select the
    **Automation Trends 2023: What's New, What's Next, and the Path to Real
    Value** on the UiPath® website. This
    will open the target selection mode in Mobile Device Manager. For more
    information on targeting UI elements, see [About Targets and
    Anchors](https://docs.uipath.com/studiox/docs/ui-automation#about-targets-and-anchors).

    ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-125982-aef8023d.webp)
11. Repeat step 10 and select **Accept and continue** from the bottom of the page.
12. Add a **Set Text** activity, click **Indicate Target** and select the **Business Email** field. Pass an email address in the **Text** field.
13. Add a **Set Text** activity, click **Indicate Target** and select the **First Name** field. Pass a name in the **Text** field.
14. Add a **Set Text** activity, click **Indicate Target** and select the **Last Name** field. Pass a name in the **Text** field.
15. Run your file to see it in action in Mobile Device Manager. You can find a list of the mobile automation activities in .

    ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-125994-c8e63442.webp)

[Download Workflow](https://documentationexamplerepo.blob.core.windows.net/examples/MobileAutomation/Web_Automation_Sample_Good.zip)

### Native Application Automation

Following this scenario, you can build an iOS Wikipedia automation workflow to search and retrieve a text from the app. Before
getting started, have a look at the [prerequisites](https://docs.uipath.com/activities/other/latest/ui-automation/creating-a-mobile-automation-workflow#creating-mobile-automation-workflows).

For this specific example, you need to configure a Wikipedia app. [Download the IPA
file](https://documentationexamplerepo.blob.core.windows.net/examples/MobileAutomation/Wikipedia.ipa) if you use a local device. Otherwise, you can specify the app
path.

![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-127255-c2fbdfc6.webp)

:::note
To add native apps on your devices see the following:
* [Bundle IDs for native iOS and iPadOS apps in mobile device management](https://support.apple.com/guide/mdm/bundle-ids-for-native-ios-and-ipados-apps-mdm90f60c1ce/web)
* [Appium – How to find android mobile app package name and launcher activity](http://www.testingtools.co/appium/appium-how-to-find-android-mobile-app-package-name-and-launcher-activity)
:::

1. Open Studio.
2. Select a **Mobile Testing Project** from the default templates.
3. Configure project details, select **C#/VB**, and then click **Create**.
4. Create a new test case and add a Sequence to your workflow.
5. Add an **Element Exists** activity within the sequence and click **Indicate Target**. This will open the target selection mode in Mobile Device Manager. For more information on targeting UI elements, see [About Targets and Anchors](https://docs.uipath.com/studiox/docs/ui-automation#about-targets-and-anchors).
6. Select the Skip button on your device screen.
7. Configure the **Exists** property with the following value: `skipButton`.
8. Click **Select Connection Details** and set your device and application.
9. Open Mobile Device Manager and [start an application](https://docs.uipath.com/activities/other/latest/ui-automation/device-interaction#device-interaction).
10. Continue by adding an **If** activity and a **Sequence** within **Then**.
11. Within the **Sequence** box, add a **Tap** activity and write the following value inside the **Condition** field.

    ```
    skipButton ==trueskipButton ==true
    ```
12. Click **Indicate Target** for the **Tap** and indicate your target on the Skip button from your device screen.
13. Continue by adding a **Set Text** and configure the **Text** property with the following value: `Manual Testing is slow`.
14. Add a **Set Text** activity to the sequence and indicate your target on the screen. For this example, you can type in: `Manual Testing is slow`.

    ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-127251-318c1e46.webp)
15. Add a **Tap** activity and indicate your target on the screen. In this example, you can select `Mobile application testing`.
16. Add a **Get Text** activity and indicate your target on the screen. For example, you can select the first paragraph.
17. Run your file to see it in action in Mobile Device Manager. You can find a list of the mobile automation activities in .

    ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/activities-docs-image-126417-0daa9716.webp)

[Download Workflow](https://documentationexamplerepo.blob.core.windows.net/examples/MobileAutomation/Native_Automation_Sample_Good.zip)
