Friday, September 23, 2016

Starting with Selenium Webdriver

If you are new to Selenium and want to learn Selenium Automation, follow the below steps to setup selenium and start automation.

1. Download latest version of Eclipse from https://www.eclipse.org/neon/
2. Unzip the zipped file after download
3. Install latest version of jdk and jre on your machine from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
4. Install firefox browser (latest version-2). I recommend to install a little previous version as it will be more compatible with selenium than the current version. http://filehippo.com/download_firefox/history/
5. Launch eclipse exe
6. It will ask you to create a workspace. Workspace will be a folder where all your projects will be placed
7. Wait for eclipse to launch. It may take a minute or two
8. If eclipse is properly launched, you will see the below eclipse homepage.
9. Now click on file in menu options > New > Other > Maven > Maven Project > Click Next > Again Next > Again Next > Enter a group id (Enter any word) > Enter Artifact id ( This will be your project name ) > Click finish
10. Clicking on finish will start downloading selenium backend files in your machine. You can see this process on bottom right of your eclipse window. Wait for it to finish.
11. Now expand to view your project files by clicking on > icon before your project name
12. You will see that there is file named pom.xml
13. Double click on pom.xml file
14. You will see that there are some tabs like overview, dependencies etc click on last tab pom.xml
15. Now open url  https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java
16. Click on first non beta version selenium java version from version column
17. You will see selenium-java dependency displayed after click which looks like below


18. Copy full selenium-java dependency
19. Paste it into your pom.xml file under <dependencies> section. Save and close pom.xml file
20 This process will download selenium-java supported files in your machine.Download progress can be seen on bottom right of eclipse window.
21. Now you are ready to start writing your first code for selenium automation in eclipse.

Follow my other posts on how to start easy automation tasks like clicking a link, selecting radio button, check box etc.

If you still face any issue, please write in comments section.

No comments:

Post a Comment