Selenium drivers


Published on

Published in: Technology
  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Selenium drivers

  1. 1. Selenium 2.x / Web Driver By Aparna Naik 1
  2. 2. AgendaWhat is WebDriverWebDriver Interface and ImplementationsFirefox DriverInternet Explorer DriverHTML Unit DriverOther Drivers 2
  3. 3. Web DriverIs a Self Contained Library• No Proxy Server like RC• Acts just as any normal libraryHas Extensive API• Easy to maintain• Robust scripting support 3
  4. 4. Web Driver Interface Selenium JavaDoc Base class for different browsers The main interface to use for testing Represents an idealised web browser Methods of WebDriver • Control of the browser itself • Selection of WebElements • Debugging aids 4
  5. 5. Web Driver WebDriver Interface Internet HTMLFirefox Opera Chrome iPhone Android Explorer Unitdriver Driver Driver Driver Driver Driver driver 5
  6. 6. Firefox DriverControls the Firefox browser using aFirefox pluginUses a stripped down profile fromwhat is installed on the machine toonly include the SeleniumWebDriver.xpi (plugin).By default, the Firefox driver createsan anonymous profile 6
  7. 7. Firefox DriverUsage WebDriver driver = new FirefoxDriver();OS Windows Mac Linux .Versions 3.0, 3.6 5, 6 7, 8 7
  8. 8. Firefox Driver - Runs in a real - Slower than the browser and HtmlUnit Driver supports JavaScript - Faster than the Internet Explorer Driver 8
  9. 9. Internet Explorer DriverStructure This driver is controlled by a .dll and is thus only available on Windows OS.Usage WebDriver driver = new InternetExplorerDriver();OS WindowsVersions IE 6, IE 7 and IE 8 on XP IE 9 on Windows7. 9
  10. 10. Internet Explorer Driver Comparatively slow Runs in a real XPath is not natively browser and supported in most versions. supports JavaScript with Sizzle is injected - Slower all the quirks than other browsers and your end users CSS selectors. see. CSS not natively supported in IE 6 and 7. Sizzle is injected instead. CSS natively supported in IE 8, 9, but doesn’t fully 10
  11. 11. HtmlUnit DriverStructure The fastest and most lightweight of Drivers. Based on HtmlUnit. HtmlUnit is a java based implementation of a WebBrowser without a GUI.Usage WebDriver driver = new HtmlUnitDriver();OS AnyVersions N/A 11
  12. 12. HtmlUnit Driver Fastest Emulates other implementation of browsers’ WebDriver JavaScript A pure Java solution behaviour and so it is platform independent. Supports JavaScript 12
  13. 13. Java Script in HtmlUnit HtmlUnit’s Java Script engine (Rhino) is not used by other popular browsers What does this mean?  If web application is tested enabling JS engine of HTMLUnit, the results may be different as compare to other browsers. 13
  14. 14. Other Drivers Chrome Driver Opera Driver iPhone Driver Android Driver 14
  15. 15. Thank You…Aparna NaikEmail: naik.aparna@destinationqa.comTel: +91 99233 50980 15