Wednesday, October 29, 2014

Chapter 17- Selenium Webdriver

Selenium - Selenese Commands

A command refers to what Selenium has to do and commands in selenium are of three types. Click on each one of them to know more about the commands.

Locators

Element Locators help Selenium to identify the HTML element, the command refers to. All these locators can be identified with the help of firepath and firebug plugin of mozilla. Please refer to environment set up chapter for details.
  • identifier=id - Select the element with the specified "id" attribute and if there is no match, select the first element whose @name attribute is id.
  • id=id Select the element with the specified "id" attribute.
  • name=name - Select the first element with the specified "name" attribute
  • dom=javascriptExpression - Selenium Finds an element by evaluating the specified string that allows us to traverse through the HTML Document Object Model using JavaScript. Users cannot return a value but can evaluate as an expression in the block.
  • xpath=xpathExpression - Locate an element using an XPath expression.
  • link=textPattern -
    Select the link element (within anchor tags) which contains text matching the specified pattern.
  • css=cssSelectorSyntax - Select the element using css selector

Selenium Webdriver

WebDriver is a tool for automating testing web application popularly known as Selenium 2.0. WebDriver uses a different underlying framework while Selenium Remote Control uses javascript Selenium-Core embedded within the browser which has got some limitations. Webdriver interacts directly with the browser without any intermediary unlike Selenium remote control which depends on a Server. It is used in the below context :
The developer community in Selenium strive hard to improve Selenium continuously and Integrating WebDriver with selenium is one among them.
  • Mult-browser testing including improved functionality for browsers not well-supported by Selenium Remote control (selenium 1.0)
  • Handling multiple frames, multiple browser windows, popups, and alerts.
  • Complex Page navigation.
  • Advanced user navigation such as Drag-and-drop.
  • AJAX-based UI elements

Architecture

Webdriver is best explained with a simple architecture diagram as shown below.
Selenium IDE 92

No comments: