Skip to main content

Selenium 2.0 (WebDriver)

WebDriver or selenium 2.0 is the most widely used tool of selenium family.  This API fit with the same role played by Selenium RC.  In simple way can be express webdriver in following format,

Selenium 1.0 (IDE) + RC = Selenium 2.0

This has come to address to reduce limitations of RC server and to overcome the IDE drawbacks (only support for Firefox browser). In the long run WebDriver goal is to provide fully object oriented supporting testing tool which will give the durable solution to many modern advanced web application testing difficulties.  

Supporting browsers
Firefox, Internet Explorer, Chrome, Safari, Opera, Android, iPhone (Calls native methods of the browsers).   
Supporting programming languages
C#, Java, Ruby, Python, JavaScript 
Supporting operating system
Windows, Solaris, Linux



Selenium 2.0 integration with Visual Studio (C#)

Setup Environment
  • Go to selenium official web site (http://www.seleniumhq.org/) .  
  • Click on download tab of the site to download required dlls,

  • Go to “Selenium Client & WebDriver Language Bindings” section of the download page and click on download button which is in front of C#.

  • If you are supposed to use different web browser than Firefox then download related driver from same download page (Firefox web browser has inbuilt selenium driver ). 
  • Now open visual studio and create new unit test project ,

  • After loading the project add downloaded selenium dlls as references. Following dlls should be added. 
              - Selenium.WebDriverBackedSelenium.dll                  
              - ThoughtWorks.Selenium.Core.dll                 
              - WebDriver.dll                  
              - WebDriver.Support.dll

  • Add as web browser driver if you are not using Firefox (click on solution -> Add -> Existing Item - > select the driver exe file -> click on Add button).  

First Test Method Create to open a website

  • Open the unit test c# file and add following selenium references. 

  • Add following code block to your test method.             

  • After adding above build the solution.
  • After successful build, right click on test method and run the test.

Issues can be occur, 
  • There can be issues to initialize webdriver if you are not using Firefox driver, then 

              - Go to properties of driver -> set Copy to Output Directory  to  Copy always. 






Comments

Popular posts from this blog

Accessibility Testing

Accessibility Testing is a non-functional testing type. This means anyone can use a particular web application, mobile application, website, or any other software package. Any human means not only perfect men or women but also differently able people as well. Things can be used for testing, 

Differences between Severity ,Priority and Status

In market there are many bug tracking and project management tools available. These tools allow us to keep essential information of a bug or task. You will see there are three places have to fill when key in a task. Those three places are Status, Priority and Status of a bug/task. Let's see what those stand for.  Severity Priority Status Connotation Severity of a bug means how much it affecting to functionality of the software. Total damage it can do. Priority means how fast a bug or task should be resolve. Status means the current position of the bug/task. Types            Critical            Major            Moderate            Minor           Cosmetic           Low           Medium           High           New           Active/Open           Resolved/Fixed           QA In progress           Reopen           Closed/Completed 

MVC Architecture

Model-View-Controller (MVC) is a design pattern recently most popular among software engineers for applications which are needed to provide multiple views with using same data. I am suggesting MVC is better than WCF, because of this module separation. For an examples       ·          Multiple views and controllers can interface with same model for modification even those never exist before add this model.       ·          It is supporting all type of HTML verbs.       ·          No view state and post back events.       ·          Easy integration with JavaScript framework.       ·          Helps to decrease complexity of project       ·          Provides RAD development ( http://en.wikipedia.org/wiki/Rapid_application_development ).