WebDriver is an automation tool useful to perform Cross Browser Testing.

Verifying the AUT(appl under test) against multiple browsers.

Limitation / Drawback –>WebDriver doesnt help us in automating Desktop based application. notepad.exe

Selenium WebDriver API (Application Programming Interface)


API Contains classes,methods,interfaces. All these are bundled and provided to us in jar file format.

A jar file named downloaded added to the build path of the project.

Apart from that we have to add the jars available under lib directory also which are required for execution.

Selenium API ->

Package ->org.openqa.selenium

Compatibility-> the should be compatible with latest version of Firefox

Steps for configuration of eclipse with Selenium->

TC_001:Verifying the title of page


1. Open FF.

2. Enter the url

3. Check the title

Expected Result:



Actual Result:


“Google is displayed”




Identification of Objects/WebElements/HTML Components can be done in 8 ways: (or) Locators:


1. id – driver.findElement(“usernmae”))

2. name- driver.findElement(“username”));


3. className- -done

class=”textboxcolor” driver.findElement(By.className(“textboxcolor”));

class=”inputtext _58mg _5dba _2ph-” //driver.findElement(By.className(“inputtext _58mg _5dba _2ph-“)); InvalidSelectorException:Compound class names not supported.

4. tagName-done


driver.findElement(By.tagName(“input”));//Select the username

5. linkText(hyperlink)-

WebElement e =driver.findElement(By.linkText(“Sign In”));

6. partialLinkText(hyperlink) for dynamic links where the text is keep on changing. So we use the static part.

WebElement e =driver.findElement(By.linkText(“Sign”));

WebElement e =driver.findElement(By.linkText(“In”));

7. cssSelector

8. xpath-> html path –

xpath – > xml path

hmtl path

Difference between close() and quit()


driver.close()-> closes the browser which has focus Ex:LoginPage.html,FB

driver.quit()->closes all the browser opened by webdriver Ex: LoginPage,Singin/ FB & DP

Leave a Reply

Your email address will not be published. Required fields are marked *