# Local Recording/Execution

When using **QApilot** for test recording with local devices, the process typically involves setting up the devices on your local network → device/system, and configuring them to work with the **QApilot** platform.

* [x] Connect the device to your system. Ensure you have enabled developer options for local testing and the **QApilot** Local Executor (Local Agent) is installed and running.
* [x] The connected device will automatically be displayed on the Test Recording Screen.

## **Software Installation:**

### Install Required Software:

<figure><img src="/files/EnILuTPTkBu9L2W0LUrU" alt=" Windows , Mac Android, Mac IOS, Linux            "><figcaption><p>     <a href="#for-windows">Windows</a>,  <a href="#for-mac-android">Mac Android</a>,  <a href="#for-mac-ios">Mac IOS</a>, and <a href="#for-linux">Linux </a>                                                          </p></figcaption></figure>

## How To Connect to the Local Device?

### Prerequisites

Ensure you create a [Project](/detailed-documentation/projects.md). Logging into the QApilot UI is a prerequisite for accessing the Projects Menu. The Projects Home page is the first screen shown after the respective user's successful login. Click the Project card to make the changes or [Create a New Project](/detailed-documentation/projects.md#how-to-create-a-new-project).

1. Click on the Project Card. Select the Recorder option from the Configurations list.\ <br>

   <figure><img src="/files/weOTBr1oixQ5phP41U2D" alt=""><figcaption></figcaption></figure>
2. The first step is to set the Connection type—selecting the kind of Environment, Cloud or Local.<br>

   <figure><img src="/files/JXu8PP2gc8cobBhmg2QE" alt=""><figcaption></figcaption></figure>
3. Select Local Devices → It will redirect to the below screen:

<figure><img src="/files/mIapURdXsMaqU4YjPcTp" alt=""><figcaption></figcaption></figure>

4. Depending on your choice, select a Desktop OS: Windows, Mac, or Linux. Connect your mobile device to your laptop or desktop.

Local Devices refer to physical devices on which the Test cases are run to check the respective app's functionality. Cloud devices refer to the devices present in the Cloud farm.

The Cloud Device setup will enable running the Test Cases on multiple mobile devices as they are integrated/configured to be part of the Automation testing environment. This arrangement will facilitate the Test Cases' check to understand the application's compatibility.

### For Windows:

#### Pre-requisites:

1. **Administrative Privileges:** The script requires administrative privileges to modify system environment variables and install applications.
2. **JDK and Android SDK Directories:** Ensure the JDK and SDK folders are located in the same directory as the script.
3. **install** [**local agent QApilot Local executor**](/detailed-documentation/setup/qapilot-executor-local-agent.md).

#### Installation Steps to follow:

1. Uninstall any previous **QApilot** builds if any.
2. Run the install.bat file.
3. If all prerequisites are met, the Setup Wizard will automatically open.
4. Follow the basic instructions & wait for the installation to complete.
5. Restart the system.
6. Run the QApilot application from your installed directory.

### For Mac Android:

#### Install android SDK

To download the latest version of Android SDK, navigate to the link [Download Android SDK](https://developer.android.com/tools/releases/platform-tools?_gl=1*1yubow8*_up*MQ..\&gclid=Cj0KCQjwiOy1BhDCARIsADGvQnBWvkKppBLUL3KnC1pGWfZRm8He13ZcG6OXsoBd1rkDhZ01kGFgXp0aAkNNEALw_wcB\&gclsrc=aw.ds)

#### Install node.js

To download the latest version of Node.js, navigate to the link [Download Node.js](https://nodejs.org/en/download)

**Download and install** [**local agent QApilot Local executor**](/detailed-documentation/setup/qapilot-executor-local-agent.md)

**Install Java and Set the Path**

1. Download the JDK from Oracle's website or use `Homebrew` to install it:

   ```
   brew install openjdk@11
   ```
2. Set up the JDK environment file:
3. echo 'export PATH="/usr/local/opt/openjdk\@11/bin:$PATH"' >> \~/.zshrc
4. echo 'export JAVA\_HOME=$(/usr/libexec/java\_home -v 11)' >> \~/.zshrc
5. source \~/.zshrc

#### Install Android Studio and Set the Path

1. Download Android Studio from the official website.
2. Run the installer and follow the setup wizard.
3. Open the downloaded file and drag Android Studio to the Applications folder.
4. Open Android Studio and follow the setup wizard.
5. Open a terminal and find the SDK path: open -e \~/.zshrc
6. Add the following lines (adjust the path as needed):
7. export ANDROID\_HOME=$HOME/Library/Android/sdk
8. export PATH=$PATH:$ANDROID\_HOME/emulator
9. export PATH=$PATH:$ANDROID\_HOME/tools
10. export PATH=$PATH:$ANDROID\_HOME/tools/bin
11. export PATH=$PATH:$ANDROID\_HOME/platform-tools
12. Save the file and reload the terminal: source \~/.zshrc

### For Linux:

#### Install android SDK

To download the latest version of Android SDK, navigate to the link [Download Android SDK](https://developer.android.com/tools/releases/platform-tools?_gl=1*1yubow8*_up*MQ..\&gclid=Cj0KCQjwiOy1BhDCARIsADGvQnBWvkKppBLUL3KnC1pGWfZRm8He13ZcG6OXsoBd1rkDhZ01kGFgXp0aAkNNEALw_wcB\&gclsrc=aw.ds)

#### Install node.js

To download the latest version of Node.js, navigate to the link [Download Node.js](https://nodejs.org/en/download)

**Download and install** [**local agent QApilot Local executor**](/detailed-documentation/setup/qapilot-executor-local-agent.md)

#### Install Java & Set Path

1. Download the JDK from Oracle's website
2. Set up the JDK environment file:
3. echo 'export PATH="/usr/local/opt/openjdk\@11/bin:$PATH"' >> \~/.zshrc
4. echo 'export JAVA\_HOME=$(/usr/libexec/java\_home -v 11)' >> \~/.zshrc
5. source \~/.zshrc

#### Install Android Studio & Set the Path

1. Download Android Studio from the official website.
2. Run the installer and follow the setup wizard.
3. Open the downloaded file and drag Android Studio to the Applications folder.
4. Open Android Studio and follow the setup wizard.
5. Open a terminal and find the SDK path: open -e \~/.zshrc
6. Add the following lines (adjust the path as needed):
7. export ANDROID\_HOME=$HOME/Library/Android/sdk
8. export PATH=$PATH:$ANDROID\_HOME/emulator
9. export PATH=$PATH:$ANDROID\_HOME/tools
10. export PATH=$PATH:$ANDROID\_HOME/tools/bin
11. export PATH=$PATH:$ANDROID\_HOME/platform-tools
12. Save the file and reload the terminal: source \~/.zshrc

Once the installations are done for your choice of OS. Extract the Local Agent launcher file.

### For Mac IOS:

#### Install Java and Set Path:

1. Download the JDK from Oracle's website [Click Here](https://www.oracle.com/in/java/technologies/downloads/) or use `Homebrew` to install it:

   ```java
   brew install openjdk@11
   ```
2. Check how to set the path [Click Here](https://docs.oracle.com/en/java/javase/23/install/installation-jdk-macos.html#GUID-C5F0BF25-3487-4F33-9275-7000C8E1C58C)

#### Install Android Studio & Set the Path

1. Download Android Studio from the official website. [Click Here](https://shorturl.at/DhMxr)
2. Check how to set the path [Click Here](https://developer.android.com/tools/variables)

#### XCode installation

1. Log in with the Developer Account on the Apple website.
2. Go to the downloads page [(https://developer.apple.com/download/)](https://developer.apple.com/download/) and download the latest version of Xcode
3. After the download is completed, double-click on the dmg file of Xcode.
4. Drag the Xcode dmg file to the application folder.

#### Install node.js

To download the latest version of Node.js, navigate to the link [Download Node.js](https://nodejs.org/en/download)

**Download and install** [**local agent QApilot Local executor**](/detailed-documentation/setup/qapilot-executor-local-agent.md)

#### Update WebDriverAgent

Download the source code of the latest version of WebDriverAgent from the below link <https://github.com/appium/WebDriverAgent/releases/latest>

### Extract Local Agent:

1. Extract the **Executor** zip file

<figure><img src="/files/8UYtc2LpTiHqznKGGByE" alt=""><figcaption></figcaption></figure>

2. Open **CMD** from the same file location

<figure><img src="/files/Y356908spQMGke170hDk" alt=""><figcaption></figcaption></figure>

3. Enter **npm i** for the first time, once the **installation** is done.

<figure><img src="/files/rrHalmKRXAvk3JQ7mYNQ" alt=""><figcaption></figcaption></figure>

4. Enter **npm start**, if the **Android SDK** **path** is set and corrected the respective screen is displayed.

<figure><img src="/files/69BSn7xU41qcd3AqZjgI" alt=""><figcaption></figcaption></figure>

5. The respective **Physical Device** will be displayed in the **Device** dropdown.
6. Enable **Developer Tools/Options** on the connected **Device/Mobile.**
7. Enable **USB Debugging**.

Applying the above two steps is mandatory to add the respective **Device** details to the QA pilot UI.

The **Mobile settings** of **Developer Tools** and **USB Debugging** for the QA pilot UI will fetch the device details. The user can use any search engine (Google/Bing) to understand how to enable the required mobile settings for the respective model (mobile company & model).

Unless the above two settings are enabled on the **Device** to be selected, the **Device** details are not shown under the **Device** dropdown to proceed to the next step.

<figure><img src="/files/7CmpoaNi7ga5J6lIZbOO" alt=""><figcaption></figcaption></figure>

8. Select the respective options from various fields(**App**, **Module, Testcase**, **Page, and VPN Required**) on **Select App & Testcase** as shown above.

The **user** can select the options from the dropdown or **click the button to create a new element for every field**.

**New element creation:**

* **Module**
* **Testcase**
* **Page**

<figure><img src="/files/w2V7BZsvlLUsr0WPCHgK" alt=""><figcaption></figcaption></figure>

9. Select App from the drop-down to test.
10. For Module:

Create Module

<figure><img src="/files/TYdLkwY63VHhZr4mZnHb" alt=""><figcaption></figcaption></figure>

11. Create a **test case** and click on the **Create** button.

<figure><img src="/files/Y0dlowGaqpdX0AnGxJ1S" alt=""><figcaption></figcaption></figure>

12. For **Page:**

&#x20;Page Title

<figure><img src="/files/pF65KJlAPx5Lvkc7GUkC" alt=""><figcaption></figcaption></figure>

13. **VPN Required** is optional. If a **VPN** is required, then a **local executor** should be running.

<figure><img src="/files/A0yTQsQyJdiLNa64qQEW" alt=""><figcaption></figcaption></figure>

14. click on **Launch** to establish a connection to your local device.

<figure><img src="/files/x7RlrKlgROdtcMCvqSqE" alt=""><figcaption></figcaption></figure>

15. The **device** will be successfully **connected** and the below **Recording Screen** will be displayed.

<figure><img src="/files/3WO2dSxNbbGvI20upWJc" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.qapilot.io/detailed-documentation/setup/local-recording-execution.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
