You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*JUnit is a popular unit testing framework for Java, and was an important part of test-driven development. It belongs to a family of unit testing frameworks known as xUnit.*
1
+
# JUnit With Appium 
*JUnit is a popular unit testing framework for Java, and was an important part of test-driven development. It belongs to a family of unit testing frameworks known as xUnit. Perform [JUnit test on LambdaTest's online cloud](https://www.lambdatest.com/appium-mobile-testing).*
6
25
7
26
*Learn the basics of [Appium testing on the LambdaTest platform](https://www.lambdatest.com/support/docs/getting-started-with-appium-testing/).*
In this topic, you will learn how to configure and run your **JUnit** automation testing scripts with **Appium** on **LambdaTest Real Device Cloud platform**.
18
-
19
-
## Objective
20
-
21
-
By the end of this topic, you will be able to:
22
-
23
-
1. Run a sample automation script of **JUnit** for application testing with **Appium** on **LambdaTest**.
24
-
2. Run test cases in **parallel** using JUnit with Appium to reduce build times.
25
-
3. Learn more about Desired Capabilities for Appium testing.
26
-
4. Explore advanced features of LambdaTest.
34
+
*[Executing The Test](#executing-the-test)
27
35
28
36
## Pre-requisites
29
37
@@ -33,7 +41,7 @@ Before you can start performing App automation testing with Appium, you would ne
33
41
34
42
### Clone The Sample Project
35
43
36
-
**Step-1:**Clone the LambdaTest’s :link:[LT-appium-java-junit](https://github.com/LambdaTest/LT-appium-java-junit) repository and navigate to the code directory as shown below:
44
+
Clone the LambdaTest’s :link:[LT-appium-java-junit](https://github.com/LambdaTest/LT-appium-java-junit) repository and navigate to the code directory as shown below:
Make sure you have your LambdaTest credentials with you to run test automation scripts on LambdaTest. To obtain your access credentials, [purchase a plan](https://billing.lambdatest.com/billing/plans) or access the [Automation Dashboard](https://appautomation.lambdatest.com/).
46
54
47
-
**Step-2:**Set LambdaTest `Username` and `Access Key` in environment variables.
55
+
Set LambdaTest `Username` and `Access Key` in environment variables.
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}`}"
56
-
65
+
66
+
```bash
67
+
set LT_USERNAME="YOUR_LAMBDATEST_USERNAME"`
68
+
set LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"
69
+
```
70
+
57
71
### Upload Your Application
58
72
59
-
**Step-3:**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:
73
+
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**commandforauthentication. 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:
{`curl -u "${ YOUR_LAMBDATEST_USERNAME()}:${ YOUR_LAMBDATEST_ACCESS_KEY()}" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -d "{\"url\":\"https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk\",\"name\":\"sample.apk\"}"`}
105
+
```bash
106
+
curl -u "YOUR_LAMBDATEST_USERNAME:YOUR_LAMBDATEST_ACCESS_KEY" -X POST "https://manual-api.lambdatest.com/app/upload/realDevice" -d "{"url":"https://prod-mobile-artefacts.lambdatest.com/assets/docs/proverbial_android.apk","name":"sample.apk"}"
107
+
```
87
108
88
109
**Tip:**
89
110
@@ -98,7 +119,7 @@ Once you are done with the above-mentioned steps, you can initiate your first JU
98
119
99
120
### Configuring Your Test Capabilities
100
121
101
-
**Step-4:**You can update your custom capabilities in test scripts. In this sample project, we are passing platform name, platform version, device name and app url (generated earlier) along with other capabilities like build name and test name via capabilities object. The capabilities object in the sample code are defined as:
122
+
You can update your custom capabilities intest scripts. In this sample project, we are passing platform name, platform version, device name and app url (generated earlier) along with other capabilities like build name and test name via capabilities object. The capabilities object in the sample code are defined as:
@@ -148,15 +169,15 @@ DesiredCapabilities capabilities = new DesiredCapabilities();
148
169
- You must add the generated **APP_URL** to the `"app"` capability in the config file.
149
170
- You can generate capabilities for your test requirements with the help of our inbuilt **[Capabilities Generator tool](https://www.lambdatest.com/capabilities-generator/beta/index.html)**. A more Detailed Capability Guide is available [here](https://www.lambdatest.com/support/docs/desired-capabilities-in-appium/).
150
171
151
-
###Executing The Test
172
+
## Executing The Test
152
173
153
-
**Step-5:**Execute the following commands to install the required dependencies:
174
+
Execute the following commands to install the required dependencies:
154
175
155
176
```bash
156
177
mvn clean
157
178
```
158
179
159
-
**Step-6:**The tests can be executed in the terminal using the following command:
180
+
The tests can be executed in the terminal using the following command:
- [How to test locally hosted apps](https://www.lambdatest.com/support/docs/testing-locally-hosted-pages/)
185
206
- [How to integrate LambdaTest with CI/CD](https://www.lambdatest.com/support/docs/integrations-with-ci-cd-tools/)
186
207
208
+
## Documentation & Resources :books:
209
+
210
+
211
+
Visit the following links to learn more about LambdaTest's features, setup and tutorials around test automation, mobile app testing, responsive testing, and manual testing.
The [LambdaTest Community](https://community.lambdatest.com/) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe.
219
+
The [LambdaTest Community](https://community.lambdatest.com/) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe 🌎
190
220
191
-
## Documentation & Resources :books:
192
-
193
-
If you want to learn more about the LambdaTest's features, setup, and usage, visit the [LambdaTest documentation](https://www.lambdatest.com/support/docs/). You can also find in-depth tutorials around test automation, mobile app testing, responsive testing, manual testing on [LambdaTest Blog](https://www.lambdatest.com/blog/) and [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/).
194
-
195
-
## About LambdaTest
221
+
## What's New At LambdaTest ❓
196
222
197
-
[LambdaTest](https://www.lambdatest.com) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.
223
+
To stay updated with the latest features and product add-ons, visit [Changelog](https://changelog.lambdatest.com/)
224
+
225
+
## About LambdaTest
226
+
227
+
[LambdaTest](https://www.lambdatest.com) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.
228
+
229
+
### Features
230
+
231
+
* Run Selenium, Cypress, Puppeteer, Playwright, and Appium automation tests across 3000+ real desktop and mobile environments.
232
+
* Real-time cross browser testing on 3000+ environments.
233
+
* Test on Real device cloud
234
+
* Blazing fast test automation with HyperExecute
235
+
* Accelerate testing, shorten job times and get faster feedback on code changes with Test At Scale.
236
+
* Smart Visual Regression Testing on cloud
237
+
* 120+ third-party integrations with your favorite tool for CI/CD, Project Management, Codeless Automation, and more.
238
+
* Automated Screenshot testing across multiple browsers in a single click.
239
+
* Local testing of web and mobile apps.
240
+
* Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems.
241
+
* Geolocation testing of web and mobile apps across 53+ countries.
242
+
* LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports
0 commit comments