Selenium Automation

Steps to setup Selenium for automation.

1. Download Firefox 16.x or later.
2. Install Selenium IDE here for Firefox:  http://docs.seleniumhq.org/download/
* You can use Selenium IDE within Firefox to record and generate html code or export to other file formats

3.  Install Eclipse http://www.eclipse.org/downloads/  [Choose a Java based distribution]
4. Download client version for java at http://www.eclipse.org/downloads/

Configure Eclipse

1. Download the Java driver and unzip them to C:\dev\selenium  (Windows)
2. Ensure Java 1.6 JDK or greater is installed
3. Install Eclipse Java IDE from http://www.eclipse.org/downloads/
4. Launch Eclipse and create New Java Project from Package Explorer
5. Accept default settings in New Java Project Wizard and click Next
6. Configure Libraries and add all the external jar files from Step #1
7. Click Finish

Create Junit Test

1. Right-click on Project and choose New > Junit Test Case2. Choose New Junit4 test and provide Test Name
3. Add code from Selenium IDE Recorder when you export the playback to Java/Junit4/Webdriver for Chrome, Firefox or IE.  Export to Java/Junit4/WebDriver backed for Firefox and IE.
4. Fix any java coding issues
5. Run the Junit test from within Eclipse

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s