Selenium Tutorial (1) - Starting with Selenium WebDriver

时间:2021-05-24 19:48:06

Starting with Selenium WebDriver

Selenium WebDriver - Introduction & Features

How Selenium WebDriver works?

Selenium WebDriver Test Cases

Running tests on Firefox, IE, Chrome

What are Web Elements?

Selenium WebDriver Locating Strategies

Web Element Inspecting Tools for different browsers

Selenium WebDriver

Selenium WebDriver was released as part of Selenium 2.0

WebDriver is designed in a simpler and better way as required for modern web applications

WebDriver uses browser native commands to drive the browser which is very robust

Overcomes following main Selenium 1.0 or Selenium RC limitations

Issues when working with pop-ups, dialogs, multiple browsers, file upload and download

WebDriver is a more Object Oriented when compared to Selenium 1.0. You can work with web elements, windows, dialogs by creating objects for them.

It supports/runs old Selenium RC code

You can use multiple programming languages like Java, C#, Ruby, Python

It supports multiple browsers and multiple operating systems

How Selenium WebDriver works?

When a class implements an interface, it provides the methods defined in that interface. With that, we can use same method names with different browsers.

WebDeiver Interface {

findElement()

getTitle()

close()

getCurrentUrl()

}

FirefoxDriver : WebDriver Interface

InternetExplorerDriver : WebDriver Interface

ChromeDriver : WebDriver Interface

Selenium WebDriver & different Drivers

WebDriver is the name of the key interface against which tests should be written, but there are several implementations

To see methods defined in the WebDriver interface and different implementations, go to http://selenium.googlecode.com/git/docs/api/java/org/openqa/selenium/WebDriver.html