As mentioned in prevois post selenium webdriver setup, hope you downloaded the Eclipse IDE and all required jar files.
NOTE: Place the Eclipse IDE and jar files under a fixed folder location, do not change the folder path once you start writing the selenium tests.
Note:
If you are using Maven project to maintain your jar files, then follow here
For manually adding jar files to your project –
Follow below steps one by one :
Step1:
Extract the zip / tar file to get the portable eclipse (no need to install).
Step2:
Once you click on the eclipse.exe,
Set the workspace path, either you can chose the default or create own folder and copy paste the path for workspace.
NOTE: Workspace path is required to store all your projects and files.
Step3:
Once Eclipse IDE is opened, click on the File -> New -> ‘Java Project’, and type project name(Let’s say MyProject),
leave all other options as it is and click on ‘Finish’
Step4:
You will get the ‘MyProject’ just created, on the left side pane:
Step5:
Right click on the ‘MyProject’, Click on New -> Package, Type ‘myPackage’ and click on ‘Finish’
Step 6:
Right click on the ‘myPackage’, Click on New -> Class, Type ‘testClass’ and check the checkbox as highlighted.
Step7:
Click on the ‘Finish’ to get the below screen, can write code under the main() method:
Step 8:
Import required selenium jar files (Downloaded as per past blog “Selenium Client and Webdriver language bindings:”) by Right click on the ‘MyProject’ and click on ‘Java Build Path’
Navigate to the tab ‘Libraries’, click on the ‘Add External JARs…’ and add all the jar files.
To import any other .jar files later time, follow step 8.
Now you are in a good shape to write a simple selenium test using eclipse IDE with Java language.
Read selenium sample test in java
2 Comments