The steps for creating a project in Eclipse for the Automation Testing using Selenium are given below:
- Create a project by navigating to File >> New >> Select project.
- Select the Java Project
- Give the project name ‘Selenium or any name’.
- Select 1.6/1.7/1.8 from dropdown Use an execution environment JRE then click on finish.
- Click on Yes to continue the setup
- Expand the Selenium Automation Project–
- Right click on JRE system library–
- Click on Build path and select Configure build path.
- Click on Add External JARs – select selenium server standalone jar file from library folder then click on ‘Open’ and ‘Ok’.
- Go to ‘Run’ click an ‘External Tools’ and select ‘External Tools Configurations’.
- Double click on the program.
- Click on ‘browser file system’ then select ‘Java.exe’ from the following path
- Click on ‘browse file system‘ in the working directory and select ‘library folder’.
- It should contain the selenium server standalone jar file.
- Give the ‘Argument’ as “–jar selenium–server–standalone–2.48.0 jar”.
- Click on ‘Apply’ and then ‘Run’.
Note: By default, selenium will run on the part ‘4444’. If required we can change part number also.
- Package is nothing but the folder where it contains classes.
- It will be available in the SRC folder of the project.
- A class is a blue print or template, it contains objects.
- An object can be anything which should physically available.
- In Java, the object is nothing but ‘datatype, method, instances’.
Public Static Void main:
- It is the main method which is responsible for execution.
- To take the elements, locators or targets, we have the below add-on’s for the browser.
Firefox fire bug and inspect element(q)
IE developer tools
Google chrome inspect element
Safari inspect element
Opera inspect element