Articles

Introduction to Selenium 2.0 Webdriver-SELENIUM

by Azhar Uddin Technical Architect

Selenium WebDriver

Selenium webdriver is also known as selenium 2.0. Web driver is a tool for automating web applications. The main aim of web driver is to provide a user friendly API.

Advantages over Selenium RC(1.0)

1. Selenium 2.0 has many new exciting features and improvements over Selenium 1.
2. Selenium 2.0 has more API than selenium 1.0
3. The new Feature is integration of the Web driver API.
4. By this web driver API we can overcome issues in Selenium 1.0
5. The goal is to develop an object-oriented API.
6. It is faster than Selenium RC / 1.0
7. There are more ways to identify objects ()
8. No need of starting a server.
9. Page synchronization is handled automatically.

For an in-depth understanding and practical experience, Explore Online Selenium Training.

How to setup Web driver using eclipse and Junit / TestNG

The set up of Web driver is quite similar to Selenium RC.
Prerequisites:
Jdk 1.5 or above
Eclipse 3.5 or above
Jar files:
 All files in selenium-java-2.X.0 folder and selenium-server-standalone-2.x.0 server file.
1. Open Eclipse.
2. File–new—Java project.
3. Enter Project Name Web Driver and click Finish.
4. A project is created.
5. Right click on JRE sys library and click buildpath—configure build path.
6. Add all external jar files (selenium-java-2.X.0 and selenium-server-standalone-2.x.0).
7. Done you are ready to write scripts using selenium webdriver.

More Ways to identify Elements

By ID:
driver.findElement(By.id(“123”));
By Name:
driver.findElement(By.name(“username”));
By Link Text:
driver.findElement(By.linklinkText(“Sign In and Register”));
By Partial Link Text:
driver.findElement(By.partialLinkText(“Sign In”));
By CSS:
driver.findElement(By.cssSelector(“.bUserBar.LikeRealBtn”));
By XPATH:
driver.findElement(By.xpath(”//input[@class=’Page_eRadioButton’]”));
By Class Name:
driver.findElement(By.className(”Page_eRadioButton”));
By Tag Name:
driver.findElement(By.tagName(”option”));


Sponsor Ads


About Azhar Uddin Advanced   Technical Architect

42 connections, 1 recommendations, 209 honor points.
Joined APSense since, May 12th, 2017, From Hyderabad, India.

Created on Feb 16th 2018 02:24. Viewed 503 times.

Comments

No comment, be the first to comment.
Please sign in before you comment.