Wednesday, 11 April 2018

Features of WebDriver

Features of WebDriver

1) “Interface WebDriver”, which represents an idealized web browser used for testing. Three categories of methods in this class.
  • Control of browser
  • WebElements selection
  • Debugging
2) We discussed above language bindings with browsers and it is just a thin wrapper which is exposed for us to write code as per our needs. This leads WebDriver to support “Multiple Languages” as well as “Multiple Support Browsers” which means that if any API supports multiple languages then this automatically leads to “Multiple Platforms”.

Multiple Languages Binding SUPPORT

WebDriver_2

Multiple Browsers SUPPORT

WebDriver_3

Multiple Platforms SUPPORT

WebDriver_4

Speed difference between RC and WebDriver

WebDriver one to one communication with “Application under Test” makes it faster than Remote Control as RC creates one more interface between communications which is RC Server makes it likes Client Server Communication. Snapshot below:-
WebDriver_5


WebDriver Existence in package org.openqa.selenium

org.openqa.selenium: The global package of Selenium which we import in our program every time when it is needed to use WebDriver. For reference, please see “org.openqa.selenium” mind map below:-
WebDriver_6
WebDriver: Is an interface comes under this package of Selenium and a sub interface of “SearchContext”. “SearchContext” consists of “WebDriver” & “WebElement” as a sub interfaces.


WebDriver Interface

Let’s see what all WebDriver contains, for example: – What is “FirefoxDriver”: is a WebDriver which is used to interact with WebApps. So, this means that all the drivers should have all the implementations which are contracted in the WebDriver interfaces and all the Drivers can be called as WebDriver. See Figure below: –
WebDriver_8
  • At high level, if we can say that Driver means as per the selection of the Explorer driver will be selected and Driver will be used to interact with Web Page.
  • Web Page composed of Web Elements and these Drivers will communicate with the Web Page.
  • For communicating with Web Page means communication with Elements present on the Web Page like for example: “Textboxes”, Buttons”, “Links” etc. “WebElement” a subinterface of “SearchContext” comes into the picture. Let’s see this Interface also (Methods name and description in the table below).
WebDriver_9
Above table is providing us all the methods which we can use to interact with WebElements on Web Page but now for performing any of the operation on Web Element, we need to find element first on Web Page as per the above table and method findElement(). For finding the element on Web Page, We need address/locator of the element and we can achieve this.

In detail below that what all WebDriver comprises of.
WebDriver_10

Highlights

  • WebDriver: One of the most core component from Selenium
  • WebDriver: With vast features where driver covers all the features and properties of explorers
  • WebDriver: Gives us the opportunity to write once and execute on multiple platforms
  • WebDriver: Provides speed to Selenium architecture where communication with Application under Test becomes faster
  • WebDriver: Despite working on any language or environment you need not learn anything new it just grabs the knowledge and start producing results
  • WebDriver: Gives opportunity to explore something from the core and can contribute from scratch till the end in the Automation process
  • WebDriver: Introduce AndroidDriver and IphoneDriver to explore the Mobile world

No comments:

Post a Comment