Sunday, January 10, 2016

Selenium WebDriver: Understanding the basics

If we talk about chemistry, Selenium is a chemical element with atomic number 34, crystalline non-metal with semiconductor properties. But since we are planning to discuss automation selenium instead of chemical selenium, this article will take a turn from chemistry to software automation. 


Before going through advanced topics on selenium automation, we should understand what is Selenium WebDriver and how to use Selenium WebDriver in automation.


Selenium WebDriver is a collection of language specific bindings to drive a browser. Languages supported by Selenium WebDriver are:

  • Python
  • Ruby
  • C#
  • Java
  • Perl
  • php
  • javascript 


The browsers that selenium Webdriver is able to drive includes:

  • Google Chrome
  • Internet Explorer 6, 7, 8, 9, 10
  • Firefox
  • Safari
  • Opera
  • HtmlUnit
  • phantomjs
  • Android (with Selendroid or appium)
  • iOS (with ios-driver or appium)

In case, we are looking to automate web application using selenium WebDriver in Java, We will use bindings for selenium in Java in the form of Jar files, which can be downloaded from selenium website.We need to build up project in Java and design the framework. Selenium Webdriver jar files are used to identify objects in the web application. Rest of the framework functions for e.g: methods for reading excel files, working with database or automating window application, we will use other bindings/tools, for e.g : jxl.jar is used for reading excel files and twin/AutoIt for identifying objects in the windows application. Similarly in case of c#, we will use the dll for selenium Webdriver.


There are different testing frameworks which can be used to automate the application, e.g: TestNG, Junit testing framework for creating automation framework in JAVA, Nunit framework with c# or creating BDD framework using spec-flow and cucumber.Similarly we can create custom frameworks with features from different frameworks. Framework used for automation should be robust, reliable, maintainable, and scalable. 


There is record and play tool known as Selenium IDE which can be added as plugin to firefox.
If you require to leverage language features, it is recommended to create a framework in Selenium WebDriver, though for quick replication, we can create a test in Selenium IDE. There are different features in Selenium IDE which are very useful one of which being exporting test in different languages.


This first post in this blog on selenium automation was like a warm up session before going and understanding in-depth concept in Selenium Automation. I too not being a veteran in selenium automation will share the information as I learn in this blog. Selenium is the biggest star in software automation at the moment, So would request readers to work with selenium, it being an open source bindings/tools. 

An excellent source amongst many on the web, I found to start working with selenium is series of videos by execute automation explaining how to work with selenium in c#:



No comments:

Post a Comment