|
1 |
| -# Java TestNG Selenium |
2 |
| - |
3 |
| -### Environment Setup |
4 |
| - |
5 |
| -1. Global Dependencies |
6 |
| - * Install [Maven](https://maven.apache.org/install.html) |
7 |
| - * Or Install Maven with [Homebrew](http://brew.sh/) (Easier) |
8 |
| - ``` |
9 |
| - $ install maven |
10 |
| - ``` |
11 |
| -2. Project Dependencies |
12 |
| - * checkout the repository |
13 |
| - * Check that packages are available |
| 1 | +# Java-TestNG-Selenium-Sample |
| 2 | + |
| 3 | + |
| 4 | +### Prerequisites |
| 5 | +1. Install and set environment variable for java. |
| 6 | + * Windows - https://www.oracle.com/java/technologies/downloads/ |
| 7 | + * Linux - ``` sudo apt-get install openjdk-8-jre ``` |
| 8 | + * MacOS - Java should already be present on Mac OS X by default. |
| 9 | +2. Install and set environment varibale for Maven. |
| 10 | + * Windows - https://maven.apache.org/install.html |
| 11 | + * Linux/ MacOS - [Homebrew](http://brew.sh/) (Easier) |
14 | 12 | ```
|
15 |
| - $ cd Java-TestNG-Selenium |
| 13 | + install maven |
16 | 14 | ```
|
17 |
| - * You may also want to run the command below to check for outdated dependencies. Please be sure to verify and review updates before editing your pom.xml file as they may not be compatible with your code. |
18 |
| - ``` |
19 |
| - $ mvn versions:display-dependency-updates |
20 |
| - ``` |
21 |
| -
|
22 |
| -**LambdaTest Authentication Credentials:** Make sure you have your LambdaTest credentials with you to run test automation scripts with Jest on LambdaTest Selenium Grid. You can obtain these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/) or through [LambdaTest Profile](https://accounts.lambdatest.com/detail/profile). |
23 |
| -
|
24 |
| -Set LambdaTest Username and Access Key in environment variables. |
25 |
| -
|
26 |
| -* For Linux/macOS: |
27 |
| -`export LT_USERNAME="YOUR_USERNAME" |
28 |
| -export LT_ACCESS_KEY="YOUR ACCESS KEY"` |
29 |
| -
|
30 |
| -* For Windows: |
31 |
| -`set LT_USERNAME="YOUR_USERNAME" |
32 |
| -set LT_ACCESS_KEY="YOUR ACCESS KEY"` |
33 | 15 |
|
34 |
| -### Running Tests |
35 |
| -
|
| 16 | +### Run your First Test |
| 17 | +1. Clone the Java-TestNG-Selenium repository. |
36 | 18 | ```
|
37 |
| -To run single test |
38 |
| - $ mvn test -D suite=single.xml |
39 |
| - |
40 |
| -To run parallel test |
41 |
| - |
42 |
| - $ mvn test -D suite=parallel.xml |
43 |
| - |
| 19 | +git clone https://github.com/LambdaTest/Java-TestNG-Selenium |
| 20 | +``` |
| 21 | +2. Next get into Java-TestNG-Selenium folder, and import Lamabdatest Credentials. You can get these from lambdatest automation dashboard. |
| 22 | + <p align="center"> |
| 23 | + <b>For Linux/macOS:</b>: |
| 24 | + |
| 25 | +``` |
| 26 | +export LT_USERNAME="YOUR_USERNAME" |
| 27 | +export LT_ACCESS_KEY="YOUR ACCESS KEY" |
| 28 | +``` |
| 29 | +<p align="center"> |
| 30 | + <b>For Windows:</b> |
44 | 31 |
|
45 | 32 | ```
|
46 |
| -## About LambdaTest |
| 33 | +set LT_USERNAME="YOUR_USERNAME" |
| 34 | +set LT_ACCESS_KEY="YOUR ACCESS KEY" |
| 35 | +``` |
| 36 | +Step 3. Make sure to install the mandatory Selenium dependencies for Maven by running the below command. |
| 37 | +``` |
| 38 | +mvn compile |
| 39 | +mvn versions:display-dependency-updates |
| 40 | +``` |
| 41 | +### Run Single Test |
| 42 | +Use the command below from the root of the project to run single tests. |
| 43 | +``` |
| 44 | +mvn test -D suite=single.xml |
| 45 | +``` |
| 46 | +### Run Parallel Test |
| 47 | +Use the command below from the root of the project to run parallel tests. |
| 48 | +``` |
| 49 | +mvn test -D suite=parallel.xml |
| 50 | +``` |
| 51 | +### Results |
| 52 | +You can check the test results on LambdaTest [Automation Dashboard](https://automation.lambdatest.com/build) |
| 53 | + |
47 | 54 |
|
| 55 | +## About LambdaTest |
48 | 56 | [LambdaTest](https://www.lambdatest.com/) is a cloud based selenium grid infrastructure that can help you run automated cross browser compatibility tests on 2000+ different browser and operating system environments. LambdaTest supports all programming languages and frameworks that are supported with Selenium, and have easy integrations with all popular CI/CD platforms. It's a perfect solution to bring your [selenium automation testing](https://www.lambdatest.com/selenium-automation) to cloud based infrastructure that not only helps you increase your test coverage over multiple desktop and mobile browsers, but also allows you to cut down your test execution time by running tests on parallel.
|
49 | 57 |
|
0 commit comments