WELCOME TO DUCAT INDIA
Language | Industrial Training | Digital Marketing | Web Technology | Testing+ | Database | Networking |
Mobile Application | ERP | Graphic | Big Data | Cloud Computing
Web Driver
Interface
7070905090
info@ducatindia.com
INTRODUCTION
Interface is like a blueprint of Class. It contains variables and body less methods i.e. Abstract
methods. An object to interface can’t be create but classes can be created where the abstract
methods of the interface can be implemented. The classes which implement the abstract methods
of interface are known as implementation classes.
The primary new feature in Selenium 2.0 is the integration of the WebDriver API. WebDriver is
designed to provide a simpler, more concise programming interface in addition to addressing
some limitations in the Selenium-RC API. Selenium-WebDriver was developed to better support
dynamic web pages where elements of a page may change without the page itself being
reloaded. WebDriver’s goal is to supply a well-designed object-oriented API that provides
improved support for modern advanced web-app testing problems. Selenium-WebDriver makes
direct calls to the browser using each browser’s native support for automation. How these direct
calls are made, and the features they support depends on the browser you are using.
Information on each ‘browser driver’ is provided later in this chapter.
For those familiar with Selenium-RC, this is quite different from what you are used to. Selenium-
RC worked the same way for each supported browser. It ‘injected’ javascript functions into the
browser when the browser was loaded and then used its javascript to drive the AUT within the
browser. WebDriver does not use this technique. Again, it drives the browser directly using the
browser’s built in support for automation.
WebDriver Architecture
Selenium WebDriver’s architecture is designed in a way that it talks to the browser in its native
language. In order to write WebDriver code to work with Firefox, code for Firefox need to be
written. If an Interface with abstract methods can be written then a message can be send to all
the browser companies i.e. the third party companies to provide their implementation classes
for an Interface. To implement the abstract methods of WebDriver interface in their way, there
are separate class files for FirefoxDriver ,ChromeDriver.
WebDriver driver = new FirefoxDriver(); or WebDriver driver= new ChromeDriver()
Above will be implementing rules of interface WebDriver over the third party browser class files
Firefox and Chrome. FirefoxDriver() and ChromeDriver() methods are defined in the class files
FirefoxDriver and ChromeDriver class files respectively.
Example of the structure of a get method
Example of a class which would implement the interface
THANK YOU
Web Driver
Interface
7070905090
info@ducatindia.com

Web driver interface

  • 1.
    WELCOME TO DUCATINDIA Language | Industrial Training | Digital Marketing | Web Technology | Testing+ | Database | Networking | Mobile Application | ERP | Graphic | Big Data | Cloud Computing Web Driver Interface 7070905090 info@ducatindia.com
  • 2.
    INTRODUCTION Interface is likea blueprint of Class. It contains variables and body less methods i.e. Abstract methods. An object to interface can’t be create but classes can be created where the abstract methods of the interface can be implemented. The classes which implement the abstract methods of interface are known as implementation classes. The primary new feature in Selenium 2.0 is the integration of the WebDriver API. WebDriver is designed to provide a simpler, more concise programming interface in addition to addressing some limitations in the Selenium-RC API. Selenium-WebDriver was developed to better support dynamic web pages where elements of a page may change without the page itself being reloaded. WebDriver’s goal is to supply a well-designed object-oriented API that provides improved support for modern advanced web-app testing problems. Selenium-WebDriver makes direct calls to the browser using each browser’s native support for automation. How these direct calls are made, and the features they support depends on the browser you are using. Information on each ‘browser driver’ is provided later in this chapter.
  • 3.
    For those familiarwith Selenium-RC, this is quite different from what you are used to. Selenium- RC worked the same way for each supported browser. It ‘injected’ javascript functions into the browser when the browser was loaded and then used its javascript to drive the AUT within the browser. WebDriver does not use this technique. Again, it drives the browser directly using the browser’s built in support for automation. WebDriver Architecture Selenium WebDriver’s architecture is designed in a way that it talks to the browser in its native language. In order to write WebDriver code to work with Firefox, code for Firefox need to be written. If an Interface with abstract methods can be written then a message can be send to all the browser companies i.e. the third party companies to provide their implementation classes for an Interface. To implement the abstract methods of WebDriver interface in their way, there are separate class files for FirefoxDriver ,ChromeDriver. WebDriver driver = new FirefoxDriver(); or WebDriver driver= new ChromeDriver()
  • 4.
    Above will beimplementing rules of interface WebDriver over the third party browser class files Firefox and Chrome. FirefoxDriver() and ChromeDriver() methods are defined in the class files FirefoxDriver and ChromeDriver class files respectively. Example of the structure of a get method Example of a class which would implement the interface
  • 5.