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, Junit 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 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 JUnit script
Note : Right-click on the class file where you pasted above code and run as Junit Test to execute the program