Configure Eclipse with Selenium WebDriver
PRACTICAL 5: Configure Eclipse with Selenium WebDriver
Selenium
is a portable software-testing framework for web applications. Selenium
provides a playback (formerly also recording) tool for authoring tests without
the need to learn a test scripting language (Selenium IDE). It also provides a
test domain-specific language (Selenese) to write tests in a number of popular
programming languages, including C#, Groovy, Java, Perl, PHP, Python, Ruby and
Scala. The tests can then run against most modern web browsers. Selenium
deploys on Windows, Linux, and mac OS platforms. It is open-source software,
released under the Apache 2.0 license
·
Launch the Eclipse IDE & Create a Workspace
§ Double click on
‘eclipse.exe’ to start eclipse.
·
Create a new Project
§ Create new Java Project from File > New >
Project.
Figure 1-creating new java project
§ Select Java Project and click Next.
§ Give your Project name ‘SetTesting’ . Click on Finish button
·
Create a new Package
§ Right click on Project name ‘SetTesting’ and select New > Package.
Figure 2-creating new package
§ Give your Package name and click on Finish button.
·
Create
a new Class
§ Right
click on Package name and select New
> Class.
§ Give
your Class name ‘FirstTestCase’, check the option ‘public static void main’ and
click on Finish button. This will bring up totally a sweet class creation
window.
§ Now
your Eclipse window will look like bellow.
Figure 3-class created
·
Add External Jars to Java build path
§ Selenium Jar file for java can be downloaded from :
Figure 4-downloading jar file
§ Right click on Project ‘SetTesting’ > Select Properties > Java build path. Then
navigate to Libraries tab and click Add
External JARs.
Figure 5-adding jar file
§ Add Selenium Java jar, you may add the source file
too.
Figure 6-selecting jar file
§ Add all the jars from the libs folder as well.
Figure 7-adding jar from lib folder
§ Click OK.
That’s all about
configuration of WebDriver with eclipse. Now you are ready to write your test
script in eclipse and run it in WebDriver.
Comments
Post a Comment