Skip to content

Commit 69d8584

Browse files
emulator - simulator
1 parent 217110b commit 69d8584

File tree

1 file changed

+34
-128
lines changed

1 file changed

+34
-128
lines changed

docs/app-automation-on-emulators-simulators.md

Lines changed: 34 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: app-automation-app-sim
3-
title: App Automation Using Emulators and Simulators on LambdaTest
3+
title: App Automation using Emulators and Simulators on LambdaTest
44
sidebar_label: Emulator / Simulator
55
description: Learn how to run app automated tests on using Emulators and Simulators on LambdaTest.
66
keywords:
@@ -14,6 +14,8 @@ slug: app-automation-on-emulators-simulators/
1414

1515
import CodeBlock from '@theme/CodeBlock';
1616
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
17+
import Tabs from '@theme/Tabs';
18+
import TabItem from '@theme/TabItem';
1719

1820
<script type="application/ld+json"
1921
dangerouslySetInnerHTML={{ __html: JSON.stringify({
@@ -38,59 +40,39 @@ import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/co
3840
})
3941
}}
4042
></script>
43+
LambdaTest enables developers and testers to automate mobile app testing using cloud-based emulators and simulators. This eliminates the need for physical devices, streamlining the process of validating app functionality across a wide range of configurations. In this documеntation, learn how to run app automated tests on Emulators and Simulators using LambdaTest virtual testing cloud.
4144

42-
---
43-
44-
In this documеntation, learn how to run app automated tests on Emulators and Simulators using LambdaTest virtual testing cloud.
45-
46-
:::info Note
47-
48-
Currently, App Automation is available for Emulators and Simulators in the Beta phase, with support for the Appium framework. To use this feature, [Contact Sales](https://www.lambdatest.com/contact-us).
45+
:::note
46+
App Automation for Emulators and Simulators (**Beta**) supports Appium; contact [LambdaTest support](mailto:[email protected]) to access..
4947
:::
5048

5149
## Prerequisites
52-
---
53-
54-
Bеforе you gеt startеd with App Automation on LambdaTеst, makе surе you havе thе following prеrеquisitеs in placе:
55-
56-
1. [Sign up for a LambdaTеst account](https://accounts.lambdatest.com/register) if you havеn't alrеady.
57-
58-
2. Install [Appium Java Client](https://github.com/appium/java-client).
59-
60-
3. A LambdaTest Username and Access Key.
50+
Before starting, ensure you have the following:
6151

62-
4. Ensure you have an access to an **Android** app (*.apk* or *.aab* file) or an **iOS** *zip* file (containing *.app* file).
52+
- Sign up for a [LambdaTest account](https://accounts.lambdatest.com/register) if you haven't already.
53+
- Download and install the [Appium Java Client](https://github.com/appium/java-client) to create automation scripts.
54+
- Retrieve your [Username and Access Key](https://accounts.lambdatest.com/security).
55+
- You have either Android application `.apk` or `.aab` or iOS application `.app` packaged in a `.zip`
6356

64-
:::tip
57+
## Step 1: Upload your application
6558

66-
Don't have **.apk** or **.app** filеs? You can still run your samplе tеsts on LambdaTеst using our samplе Android and iOS applications, accеssiblе through thе following links:
67-
68-
* [Samplе Android App](https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk)
69-
* [Samplе iOS App](https://prod-mobile-artefacts.lambdatest.com/assets/docs/firefox.zip)
59+
Upload your **iOS** application (*.app* file) or **Android** application (*.apk* file) to the LambdaTest servers using our **REST API**.
7060

61+
:::tip Sample repo
62+
You can download the sample codebase to quickly run your tests. <a href="https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk" className="github__anchor"><img loading="lazy" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/> Android sample app</a> <a href="https://prod-mobile-artefacts.lambdatest.com/assets/docs/firefox.zip" className="github__anchor"><img loading="lazy" src={require('../assets/images/icons/github.png').default} alt="Image" className="doc_img"/>iOS sample app</a>
7163
:::
7264

73-
## Run Your First Test
74-
---
75-
76-
Here are the following steps to run your first app automated test on Emulators and Simulators.
77-
78-
### Step 1: Upload Your Application
79-
80-
Upload your **iOS** application (*.app* 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:
81-
82-
import Tabs from '@theme/Tabs';
83-
import TabItem from '@theme/TabItem';
65+
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:
8466

8567
<Tabs className="docs__val">
8668
<TabItem value="file" label="App file" default>
8769

8870
<Tabs className="docs__val">
89-
<TabItem value="macos-file" label="Linux/macOS" default>
71+
<TabItem value="macos-file" label="Linux / macOS" default>
9072

9173
<div className="lambdatest__codeblock">
9274
<CodeBlock className="language-bash">
93-
{`curl -u "<USERNAME>:<KEY>" \
75+
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" \
9476
--location --request POST 'https://manual-api.lambdatest.com/app/upload/virtualDevice' \
9577
--form 'name="Android_App"' \
9678
--form 'appFile=@"/Users/macuser/Downloads/proverbial_android.apk"'
@@ -103,7 +85,7 @@ import TabItem from '@theme/TabItem';
10385
<TabItem value="windows-file" label="Windows" default>
10486
<div className="lambdatest__codeblock">
10587
<CodeBlock className="language-powershell">
106-
{`curl -u "<USERNAME>:<KEY>" \
88+
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" \
10789
--location --request POST 'https://manual-api.lambdatest.com/app/upload/virtualDevice' \
10890
--form 'name="Android_App"' \
10991
--form 'appFile=@"/Users/macuser/Downloads/proverbial_android.apk"'
@@ -117,7 +99,7 @@ import TabItem from '@theme/TabItem';
11799
<TabItem value="url" label="App URL" default>
118100

119101
<Tabs className="docs__val">
120-
<TabItem value="macos-url" label="Linux macOS" default>
102+
<TabItem value="macos-url" label="Linux / macOS" default>
121103

122104
<div className="lambdatest__codeblock">
123105
<CodeBlock className="language-bash">
@@ -142,20 +124,14 @@ import TabItem from '@theme/TabItem';
142124
</TabItem>
143125
</Tabs>
144126

145-
:::info Note
146-
147-
Response of above cURL will be a **JSON** object containing the `App URL` of the format - ``lt://APP123456789123456789`` and will be used in the Step 2.
148-
127+
:::info
128+
Response of above cURL will be a **JSON** object containing the `App URL` of the format - ``lt://APP123456789123456789`` and will be used in next steps.
149129
:::
150130

151-
### Step 2: Write Your Automation Script
152-
153-
1. Write your automation script in your preferred language that Appium framework supports.
131+
## Step 2: Write your automation script
132+
Write your automation script in your preferred language that Appium framework supports. In the below test script, ensure to update the `app_url`, `username` and `accesskey`.
154133

155-
In the below test script, ensure to update the `app_url`, `username` and `accesskey`.
156-
157-
158-
:::info Set the Capability
134+
:::tip Note
159135
To run the test on Emulator/Simulator, set the `isRealMobile` capability to `false`.
160136
:::
161137

@@ -363,82 +339,12 @@ simulatorTest()
363339
</TabItem>
364340
</Tabs>
365341

366-
2. Create `.XML` file in order to run your test and define device capabilities. Please find sample code below for the same.
367-
368-
<Tabs className="docs__val">
369-
<TabItem value="androidXML" label="Android" default>
370-
371-
```xml
372-
<?xml version="1.0" encoding="UTF-8"?>
373-
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
374-
<suite thread-count="100" name="Mobile" parallel="tests">
375-
376-
377-
<test name="AppTest 1">
378-
<parameter name="version" value="11"/>
379-
<parameter name="platform" value="Android"/>
380-
<parameter name="device" value="Galaxy S21 Ultra 5G"/>
381-
<classes>
382-
<class name="AndroidApp"/>
383-
</classes>
384-
</test>
385-
386-
<test name="AppTest 2">
387-
<parameter name="version" value="11"/>
388-
<parameter name="platform" value="Android"/>
389-
<parameter name="device" value="Galaxy S21"/>
390-
<classes>
391-
<class name="AndroidApp"/>
392-
</classes>
393-
</test>
394-
</suite>
395-
```
396-
397-
</TabItem>
398-
399-
<TabItem value="iOSXML" label="iOS" default>
400-
401-
```xml
402-
<?xml version="1.0" encoding="UTF-8"?>
403-
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
404-
<suite thread-count="100" name="Mobile" parallel="tests">
405-
406-
407-
<test name="iOSApp 1">
408-
<parameter name="version" value="14"/>
409-
<parameter name="platform" value="iOS"/>
410-
<parameter name="device" value="iPhone 11"/>
411-
<classes>
412-
<class name="iOSApp"/>
413-
</classes>
414-
</test>
415-
416-
<test name="iOSApp 2">
417-
<parameter name="version" value="14"/>
418-
<parameter name="platform" value="iOS"/>
419-
<parameter name="device" value="iPhone 12 Pro"/>
420-
<classes>
421-
<class name="iOSApp"/>
422-
</classes>
423-
</test>
424-
</suite>
425-
```
426-
427-
</TabItem>
428-
</Tabs>
429-
430-
### Step 3: Execute Your Test Case
431-
432-
Debug and run your code. Run `iOSApp.java` or `AndroidApp.java` in your editor.
342+
## Step 3: Execute your test case
433343

434-
### Step 4: View Test Execution
435-
436-
Once you have run your tests, you can view the test execution along with logs. You will be able to see the test cases passing or failing. You can view the same at LambdaTest [App Automation Dashboard](https://appautomation.lambdatest.com/build).
344+
Run `iOSApp.java` or `AndroidApp.java` in your editor to debug and run your code. You can view the same at LambdaTest [App Automation Dashboard](https://appautomation.lambdatest.com/build).
437345

438346
## More About Desired Capabilities
439-
---
440-
441-
Sample Capabilities for both Android and iOS are mentioned below -
347+
LambdaTest supports a wide range of additional Desired Capabilities to customize your testing environment:
442348
<Tabs className="docs__val">
443349
<TabItem value="androidCaps" label="Android" default>
444350

@@ -447,12 +353,13 @@ Sample Capabilities for both Android and iOS are mentioned below -
447353
"deviceName": "Galaxy Tab S4",
448354
"platformName": "android",
449355
"platformVersion": "10",
450-
"app": "App_url",
356+
"app": "YOUR_APP_URL", //Enter your APP URL fetched in above steps
357+
// highlight-next-line
358+
"isRealMobile": false,
451359
"visual": true,
452360
"console": true,
453361
"deviceOrientation": "PORTRAIT",
454362
"build": "new-12",
455-
"isRealMobile": false,
456363
}
457364
```
458365

@@ -464,7 +371,8 @@ Sample Capabilities for both Android and iOS are mentioned below -
464371
"deviceName": "iPhone 12 Mini",
465372
"platformName": "ios",
466373
"platformVersion": "14",
467-
"app": "App_url",
374+
"app": "YOUR_APP_URL", //Enter your APP URL fetched in above steps
375+
// highlight-next-line
468376
"isRealMobile": false,
469377
"visual": true,
470378
"console": true,
@@ -474,6 +382,4 @@ Sample Capabilities for both Android and iOS are mentioned below -
474382
```
475383

476384
</TabItem>
477-
</Tabs>
478-
479-
385+
</Tabs>

0 commit comments

Comments
 (0)