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
Make sure you have your LambdaTest credentials with you to run test automation scripts. You can get these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build?utm_source=github&utm_medium=repo&utm_campaign=junit-selenium-sample) or by your [LambdaTest Profile](https://accounts.lambdatest.com/login?utm_source=github&utm_medium=repo&utm_campaign=junit-selenium-sample).
70
+
Make sure you have your LambdaTest credentials with you to run test automation scripts. You can get these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/build?utm_source=github&utm_medium=repo&utm_campaign=junit-autoheal-sample) or by your [LambdaTest Profile](https://accounts.lambdatest.com/login?utm_source=github&utm_medium=repo&utm_campaign=junit-autoheal-sample).
72
71
73
72
**Step 2:** Set LambdaTest **Username** and **Access Key** in environment variables.
74
73
@@ -86,50 +85,47 @@ Make sure you have your LambdaTest credentials with you to run test automation s
86
85
87
86
## Run Your First Test
88
87
89
-
>**Test Scenario**: Checkout sample [JUnitTodo.java](https://github.com/LambdaTest/junit-selenium-sample/blob/master/src/test/java/com/lambdatest/JUnitTodo.java) file. This JUnit Selenium script tests a sample to-do list app by marking couple items as done, adding a new item to the list and finally displaying the count of pending items as output.
88
+
>**Test Scenario**: This test automates the process of searching for a book titled "Python Programming" in the Books category on Amazon.in using the LambdaTest platform.
89
+
90
+
**📋 Test Steps**
91
+
- The script initializes a remote WebDriver session on LambdaTest with the desired capabilities (Windows 10, Chrome browser).
92
+
- The Amazon.in website is loaded.
93
+
-**The script updates the ID attributes of the search submit button and search textbox.**
94
+
- The search category dropdown is clicked to reveal the list of categories.
95
+
- The 'Books' category is selected from the dropdown.
96
+
- The term "Python Programming" is entered into the search textbox.
97
+
- The search button is clicked to initiate the search.
98
+
99
+
With `AutoHeal` Enable, the test scenario passed even after updating the ID attribute of submit button.
90
100
91
101
### Configuring your Test Capabilities
92
102
93
103
**Step 3:** In the test script, you need to update your test capabilities. In this code, we are passing browser, browser version, and operating system information, along with LambdaTest Selenium grid capabilities via capabilities object. The capabilities object in the above code are defined as:
You can generate capabilities for your test requirements with the help of our inbuilt [Desired Capability Generator](https://www.lambdatest.com/capabilities-generator/?utm_source=github&utm_medium=repo&utm_campaign=junit-selenium-sample).
117
+
You can generate capabilities for your test requirements with the help of our inbuilt [Desired Capability Generator](https://www.lambdatest.com/capabilities-generator/?utm_source=github&utm_medium=repo&utm_campaign=junit-autoheal-sample).
108
118
109
119
### Executing the Test
110
120
111
121
**Step 4:** The tests can be executed in the terminal using the following command.
112
122
113
123
```bash
114
-
mvn test -P single
124
+
export AUTOHEAL=true;mvn test -P autoheal
115
125
```
116
126
117
127
Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on [LambdaTest automation dashboard](https://automation.lambdatest.com/build).
118
128
119
-
## Run Parallel Tests Using JUnit
120
-
121
-
Check out the [Parallelized.java](https://github.com/LambdaTest/junit-selenium-sample/blob/master/src/test/java/com/lambdatest/Parallelized.java) class we have used for running our Parallel Tests using JUnit.
122
-
123
-
124
-
Check out the [JUnitConcurrentTodo.java](https://github.com/LambdaTest/junit-selenium-sample/blob/master/src/test/java/com/lambdatest/JUnitConcurrentTodo.java) file for executing parallel test using JUnit automation framework.
125
-
126
-
### Executing Parallel Tests Using JUnit
127
-
128
-
To run parallel tests using **JUnit**, we would have to execute the below command in the terminal:
129
-
130
-
```bash
131
-
mvn test -P parallel
132
-
```
133
129
134
130
## Testing Locally Hosted Or Privately Hosted Projects
0 commit comments