-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,57 @@ | ||
# Java TestNG Selenium | ||
|
||
### Environment Setup | ||
|
||
1. Global Dependencies | ||
* Install [Maven](https://maven.apache.org/install.html) | ||
* Or Install Maven with [Homebrew](http://brew.sh/) (Easier) | ||
``` | ||
$ install maven | ||
``` | ||
2. Project Dependencies | ||
* checkout the repository | ||
* Check that packages are available | ||
# Java-TestNG-Selenium-Sample | ||
 | ||
|
||
### Prerequisites | ||
1. Install and set environment variable for java. | ||
* Windows - https://www.oracle.com/java/technologies/downloads/ | ||
* Linux - ``` sudo apt-get install openjdk-8-jre ``` | ||
* MacOS - Java should already be present on Mac OS X by default. | ||
2. Install and set environment varibale for Maven. | ||
* Windows - https://maven.apache.org/install.html | ||
* Linux/ MacOS - [Homebrew](http://brew.sh/) (Easier) | ||
``` | ||
$ cd Java-TestNG-Selenium | ||
install maven | ||
``` | ||
* 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. | ||
``` | ||
$ mvn versions:display-dependency-updates | ||
``` | ||
**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). | ||
Set LambdaTest Username and Access Key in environment variables. | ||
* For Linux/macOS: | ||
`export LT_USERNAME="YOUR_USERNAME" | ||
export LT_ACCESS_KEY="YOUR ACCESS KEY"` | ||
* For Windows: | ||
`set LT_USERNAME="YOUR_USERNAME" | ||
set LT_ACCESS_KEY="YOUR ACCESS KEY"` | ||
### Running Tests | ||
### Run your First Test | ||
1. Clone the Java-TestNG-Selenium repository. | ||
``` | ||
To run single test | ||
$ mvn test -D suite=single.xml | ||
|
||
To run parallel test | ||
|
||
$ mvn test -D suite=parallel.xml | ||
|
||
git clone https://github.com/LambdaTest/Java-TestNG-Selenium | ||
``` | ||
2. Next get into Java-TestNG-Selenium folder, and import Lamabdatest Credentials. You can get these from lambdatest automation dashboard. | ||
<p align="center"> | ||
<b>For Linux/macOS:</b>: | ||
``` | ||
export LT_USERNAME="YOUR_USERNAME" | ||
export LT_ACCESS_KEY="YOUR ACCESS KEY" | ||
``` | ||
<p align="center"> | ||
<b>For Windows:</b> | ||
``` | ||
## About LambdaTest | ||
set LT_USERNAME="YOUR_USERNAME" | ||
set LT_ACCESS_KEY="YOUR ACCESS KEY" | ||
``` | ||
Step 3. Make sure to install the mandatory Selenium dependencies for Maven by running the below command. | ||
``` | ||
mvn compile | ||
mvn versions:display-dependency-updates | ||
``` | ||
### Run Single Test | ||
Use the command below from the root of the project to run single tests. | ||
``` | ||
mvn test -D suite=single.xml | ||
``` | ||
### Run Parallel Test | ||
Use the command below from the root of the project to run parallel tests. | ||
``` | ||
mvn test -D suite=parallel.xml | ||
``` | ||
### Results | ||
You can check the test results on LambdaTest [Automation Dashboard](https://automation.lambdatest.com/build) | ||
 | ||
## About LambdaTest | ||
[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. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.