id | title | sidebar_label | description | keywords | image | url | site_name | slug | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
hyperexecute-appium-testing |
Appium Testing - Real Device On HyperExecute |
Appium - Real Device |
Maximize Appium test execution with HyperExecute – Explore LambdaTest's support documentation for seamless automation testing. |
|
/assets/images/og-images/appium-testing-og-image.jpg |
LambdaTest |
hyperexecute-appium-testing/ |
import CodeBlock from '@theme/CodeBlock'; import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys"; import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
<script type="application/ld+json" dangerouslySetInnerHTML={{ __html: JSON.stringify({ "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "Home", "item": "https://www.lambdatest.com" },{ "@type": "ListItem", "position": 2, "name": "Support", "item": "https://www.lambdatest.com/support/docs/" },{ "@type": "ListItem", "position": 3, "name": "Getting Started With Appium Testing on LambdaTest", "item": "https://www.lambdatest.com/support/docs/hyperexecute-appium-testing/" }] }) }} ></script>This page outlines how to execute your Appium tests on HyperExecute using TestNG with YAML 0.2
HyperExecute uses YAML 0.2 to perform the tests using Appium.
To run the Tests on HyperExecute from your Local System, you are required:
- HyperExecute YAML file which contains all the necessary instructions.
- HyperExecute CLI in order to initiate a test execution Job .
- Your lambdatest Username and Access key
- Setup the Environmental Variable
- Ensure you have Appium’s Java client library installed.
- Access to an Android app (.apk or .aab file) or an iOS app (.ipa file).
:::tip Sample repo All the code samples in this documentation can be found on LambdaTest's Github Repository. You can either download or clone the repository to quickly run your tests. <img loading="lazy" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/> View on GitHub :::
If you do not have any .apk or .ipa file, you can run your sample tests on LambdaTest by using our sample 🔗 Android app or sample 🔗 iOS app.
The HyperExecute CLI is used for triggering tests on HyperExecute. It is recommend to download the HyperExecute CLI binary on the host system to perform the tests on HyperExecute. The CLI download site for various platforms is displayed below:
Platform | HyperExecute CLI download location |
---|---|
Windows | https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe |
macOS | https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute |
Linux | https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute |
Export the environment variables LT_USERNAME and LT_ACCESS_KEY that are available in the LambdaTest Profile page. Run the below mentioned commands in the terminal to setup the CLI and the environment variables.
Upload your iOS application (.ipa file) or android application (.apk file) to the LambdaTest servers using our REST API. You need to provide your Username and AccessKey in the format Username:AccessKey
in the cURL command for authentication. Make sure to add the path of the appFile in the cURL request. Here is an example cURL request to upload your app using our REST API:
Response of above cURL will be a JSON object containing the
App URL
of the format -lt://APP123456789123456789
and will be used in the next step.
Write Your Automation Script in the client language of your choice from the ones supported by Appium. An automation script for the sample applications have been provided below.
Here is a sample automation script in Java for the sample app downloaded above. Ensure to update the app_url
, username
and accesskey
in the below code.
https://github.com/LambdaTest/hyperexecute-real-device-appium-testng/blob/main/src/main/java/AndroidApp.java
https://github.com/LambdaTest/hyperexecute-real-device-appium-testng/blob/main/src/main/java/iOSApp.java
Create .XML
file in order to run your test and define device capabilities. Please find sample code below for the same.
The
region
parameter specifies the region or location where the Appium tests will be executed. Our platform supports the following three regions:
- ap (Asia-Pacific)
- us (United States)
- eu (European Union)
NOTE : In case of MacOS, if you get a permission denied warning while executing CLI, simply run
chmod u+x ./hyperexecute
to allow permission. In case you get a security popup, allow it from your System Preferences → Security & Privacy → General tab.
Run the below command in your terminal at the root folder of the project:
./hyperexecute --config RELATIVE_PATH_OF_YOUR_YAML_FILE
OR use this command if you have not exported your username and access key in the step 2.
To configure SmartUI with HyperExecute, you need to simply add a capability in your test file:
"smartUI.project": "<YOUR_SMARTUI_PROJECT_NAME>"
Refer to the Automation Capabilities Generator to understand how to write the capability in different languages.
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/appium/capability-generator.png').default} alt="automation-dashboard" width="1920" height="868" className="doc_img"/>
Sample Capabilities for both android and iOS are mentioned below -
{
"deviceName": "Galaxy Tab S4",
"platformName": "android",
"platformVersion": "10",
"app": "App_url",
"visual": True,
"console": True,
"deviceOrientation": "PORTRAIT",
"build": "new-12",
"isRealMobile": True,
}
{
"deviceName": "iPhone 12 Mini",
"platformName": "ios",
"platformVersion": "14",
"app": "App_url",
"isRealMobile": True,
"visual": True,
"console": True,
"build": "lt-web-4",
"network": True,
}
For more details, please refer to our guide on Desired Capabilities in Appium.
Every test run on the HyperExecute has a unique jobId associated with it. Each jobId can in turn constitute single (or multiple) groupId(s). You can visit HyperExecute automation dashboard for checking the status of the test execution.
The snapshot below shows how to navigate to the respective testID for viewing the Selenium logs:
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/appium/hyperexecute-appium.png').default} alt="automation-dashboard" width="1920" height="868" className="doc_img"/>