This blog will help you to test web applications i.e. applications hosted on the web by using functional testing tool (selenium webdriver) with java, Maven, TestNG and Saucelabs.
- You must have JDK 1.5 or higher installed (Java Installation), set the java path (Java Environment path setup).
- You must have eclipse Installed (Eclipse installation).
- You must have installed maven (Maven installation).
- You must have installed TestNG plug-in to the eclipse (Add TestNG plug-in to Eclipse).
- You must have installed Maven plug-in to the eclipse (Add Maven plug-in to Eclipse).
- Create a maven project in eclipse (Create maven project).
- Update dependencies in pom.xml
- Must have SauceLabs account (Crete SauceLabs trial account or you can use existing account.)Steps to get username and accesskey of Saucelabs
- Login to sauce labs
- Go to ‘My Account’ from the username right arrow mark drop down
- Click on ‘Show’ button to get the ‘Access Key’ check below image
Dependencies to add pom.xml
Sample TestNG script
Note : Right-click on the class file where you pasted above code and run as TestNG Test to execute the program