Wednesday, March 26, 2014

Selenium Demo Guide

Selenium Demo Guide

Prerequisites:

1. Mozilla Firefox

2. Selenium RC Server (2+): This can be downloaded http://selenium.googlecode.com/files/selenium-server-standalone-2.8.0.jar

3. Dot-Net Client Drivers: This can be downloaded from “http://selenium.googlecode.com/files/selenium-dotnet-2.9.0.zip
Note: If above link does not work, then simply go to “http://seleniumhq.org/download/” and under “Selenium Client Drivers” Section click download for your desired specified programming language.


5. Microsoft Visual Studio

6. JRE 1.5 or later = JRE must be installed in your system


Steps to run Test Scripts
  1. Download and install Nunit, JRE 1.5 or later, Visual Studio and Mozilla Firefox.
  2. Download Dot-Net Client Drivers and Install them(For installation purpose Read “Dot-NET client driver configuration” topic below )
  3. Download Selenium RC server and Place it at Path : “C:\”
  4. Go to Command Prompt and Enter “cd \”
  5. In the command prompt Enter C:/ “java -jar selenium-server-standalone-2.8.0.jar -trustAllSSLCertificates”
  6. Open “FDNetAutomation.sln” file using visual studio 2008 to open the project
  7. Click Build Solution.
  8. Open Nunit.
  9. Open Project by selecting “FDNetAutomation.dll” from Project Path “\FDNetAutomation\bin\Debug\”.
  10. Right Click in the Test Scripts name pane and Select “Show Checkboxes”
  11. Select Checkboxes of Test cases you want to run .
  12. Go to “Test” Menu option and Select “Run All” or “Run Selected” as per requirement.
  13. Test Results: After completion of test cases Go to “\FDNetAutomation\bin\Debug\” and open “TestResult.xml” this shows the results.


The script will run now in 2 Mozilla Firefox browsers and if the status will be failed then there will be a red bar in Nunit and if status will be passed then the bar will be green.

Among two browsers one will display the log and other will execute the script in GUI format.

The browsers will be automatically closed after the execution of each test case.


If want to change test data then can change from “\FDNetAutomation\data” and the corresponding test case XML file.

Note: The data should be identical in case anything is changed


Dot-NET client driver configuration
.NET client Driver can be used with Microsoft Visual Studio. To configure it with Visual Studio do as Following.

  • Launch Visual Studio and Open Your Project.
  • Under right hand pane of Solution Explorer right click on References > Add References.
  • Go to “Browse” tab under “Add Reference”.
  • Navigate to the location where Dot-Net Client Drivers have been downloaded and Extracted.
  • Select all “dll” files and click on Ok button.

No comments:

Post a Comment