Introduction to Selenium WebDriver
WebDriver is a selenium libraries
which is developed in java and included from Selenium Ver. 2.0 onwards.
Not like the earlier version of Selenium
RC , WebDriver API will directly interact with the Respective browsers like
Firefox, IE, Chrome…etc
Selenium WebDriver will do the same
as RC (Remote Control) will do, these are additional libraries which are added
into Selenium Ver. So
Selenium 1.0 (RC Libraries) +
WebDriver (Libraries) + Grid Libraries = Selenium 2.0
- WebDriver is more simpler than RC and it over comes some of the limitations of RC like file upload or download, pop-ups and dialogs barrier
- WebDriver is a pure Object Oriented Programming language developed in java where as RC is developed in JavaScript
- Selenium RC to execute Server need to run first , the selenium program will interact with Selenium Server and Server will interact with Browser like FF, IE..etc, where as webdriver will directly interacts with Browser
WebDriver is an interface and we can
use the below classes to develop the scripts,
AndroidDriver, ChromeDriver, EventFiringWebDriver, FirefoxDriver,
HtmlUnitDriver, InternetExplorerDriver, IPhoneDriver, PhantomJSDriver,
RemoteWebDriver, SafariDriver
Ex: The below Webdriver program uses FirefoxDriver API to
open any given URL
public class Sample
{
public static void main(String
args[ ])
{
FirefoxDriver driver=new FirefoxDriver();
Driver.get(“http://www.google.com”);
}
}
In the above code, object is created for FirefoxDriver
class and using the method get(url) to pen the given url in the firefox browser
Comments
Post a Comment