Sunday 27 October 2013

What is selenium webdriver?

Selenium web driver is the most popular browser automation testing tool. Project is hosted at https://github.com/seleniumhq/selenium.

Key features of Selenium Webdriver are -
  1. Open source
  2. Supports all major browsers - IE, Firefox, Chrome, Safari, Opera
  3. API is available in all popular languages like Java, Groovy, C#, PHP, Python etc.
  4. Selenium Webdriver is a W3C standard protocol for Browser Automation
  5. Supports testing for Desktop web applications, iOS and Android mobile applications
  6. Testing web applications on emulated mobile devices is possible using mobile emulation in chrome
For every web browser, there is a separate web driver implementation that helps us automate the browser operations.

For example ->

If you want to automate chrome, you will need chromedriver. Chromedriver is an application file that is used to perform the operations on browser.Similarly for firefox and Internet Explorer there are different drivers.

System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
WebDriver driver =  new ChromeDriver();

Above code will create new web driver reference that can be used to automate the test cases on chrome browser.

File profileDir = new File("C:\\Users\\Firefox\\Profiles\\default");
 FirefoxProfile profile = new FirefoxProfile(profileDir);
 wb =  new FirefoxDriver(profile);

Above code will launch firefox.

What do you think on above selenium topic. Please provide your inputs and comments. Thanks

2 comments:

Buy Best Selenium Books

Contributors