Software Testing Interview Questions - This blog about types of Software Testing,Bug Report Guidelines and testing related questions and answers.This blog provides information about SQL and testing.
Thursday, May 23, 2013
Monday, May 20, 2013
NUnit Documentation
- Installing NUnitAsp requires only a few steps
- Download and unzip NUnitAsp.
- You've probably already done this step, but if not, read on.
- Unzip the NUnitAsp package into a directory of your choice, such as "C:\Program Files\NUnitAsp"
- Install NUnit.
- You can use any testing tool, but NUnit is the most common.
- Reference NUnitAsp in your test projects.
- Copy bin\NUnitAdapter.cs into your test project. (This file isn't required, but it makes working with NUnit easier.)
- Add bin\nunitasp.dll as a reference.
Steps
To Work With NUnit
- Install Download NUnit which is an open source.
- Install Nuint in your system
- Add References in Website we need to test
C:\Program
Files\NUnit 2.5.2\bin\net-2.0\framework
i.e.
nunit.framework.dll
nunit.mock.dll
nunit.framework.dll
4)
Add Class file to your App_Code (same directory of class file
which you want to test).
- Create your own test cases in that class file.
6.Publish your website and store all assembly in a folder outside the root directory
7. Create
a config file for your Assembly (e.g. if your assembly name is
App_Code.dll
then
its config file should be App_Code.dll.config)
How
selenium Run through NUnit:
- Open NUnit IDE through start menu.
- Go to File > Open Project
- Navigate to the directory where your dll is saved
- Add Assembly to NUnit. (e.g. App_Code.dll)
- Click on Run and the test cases will run
The
test cases will run now and if the status will be failed then there
will be a red bar and if Status is
Passed
then there will be a green bar.
Result
Evaluation
Result
can be analyzed from result status bar.
When
Script is passed the status Bar is green and number of passed script
are shown (as shown below).
When
the script is failed then the status bar id Red number of passed
script as well.
Test
result will also store in xml form in the same directory where your
dll is and it is shown.
Special
Note:
- As NUnit does not recognize Global.asax , So we have to add [SetUp] method, this method will be called before each test method in the derived class so mention all that things we need to initialize before running the test cases
- It also doesn’t recognize Web.config. So we have to create a separate config file for your dll (if your dll is App_Code.dll then your config should be App_Code.dll.config and it should be in the same directory where your dll is)
- We are not running the test cases in web environment , so we cannot access Session variableHow to execute Selected test cases with NUnit:
- Open NUnit and select File >> Open
- Navigate the search folder where our selenium project is kept.
- Then double click on project .
- Go to bin folder and again double click here.
- Go to debug folder and again double click here.
- Here select project name dll file and click on it and then press open button of pop-up.
- Right click on header line and select collapse of location. Please see screen shot below.9) Click on + sign button and then all test fixture is open.10) Select desire test case which we want to execute, Click on + sign button regarding same test case.11) Select different test scripts with the help oh check box. Here we select many test scripts through checkbox according to scripts.12) Go to Test menu and click on Run All or press F5 button.For this only desire test scripts are execute and it gives only result which we want.How selenium project execute through NUnit:
- Go to selenium project location means where keep selenium project.
- Double Click on selenium project .
- Click on visual studio file which name is same as project name.
- Open Solution Explorer.
- Click on App.config file
- we want to execute this project.
- Click save button from the top save button menu bar.
- Click on Build button from the Build menu bar.
10) Then Open NUnit and select File >> Open11) Navigate the search folder where our selenium project is kept.12) Then double click on project .13) Go to bin folder and again double click here.14) Go to debug folder and again double click here.15) Here select project name dll file and click and then press open button of pop-up.
- After full test run we go click on Tools menu and again click save results as XML
- We give here desire location where we want to save this result.
- This result in XML format.
- Open this result and analyze pass and failure test cases with description.
Wednesday, May 8, 2013
Selenium User Guide
Selenium User Guide
Prerequisites:
- Selenium IDE : This is a Mozilla Firefox’s addon and can be downloaded from http://release.seleniumhq.org/selenium-ide/1.0.10/selenium-ide-1.0.10.xpi . An addon will ask permission for installation. Follow the steps and restart firefox. Now Selenium IDE is installed and can be accessed through Mozilla Firefox > Tools > Selenium IDE.(Note: The provided link should be opened only through Mozilla Firefox Browser)
- SeleniumRCServer: This can be downloadedhttp://selenium.googlecode.com/files/selenium-remote-control-1.0.3.zip .
- Nunit:Thiscanbedownloadedfromhttp://launchpad.net/nunitv2/2.5/2.5.9/+download/NUnit-2.5.9.10348.msi .
- Microsoft Visual Studio
- JRE 1.5 or later
Test Script types in Selenium:
- Basic
tabular scripts.
- Advanced
scripts.
Basic tabular scripts
The
scripts recorded by Selenium IDE are initially in this format. These
scripts are in the tabular format and run by Selenium IDE itself.
Advanced scripts
These
scripts are programming language specific. And can run through Nunit
+ RC Server.
- Start Selenium IDE.
- Go to File > Open (Navigate to the location where basic scripts are available)
- Select the script(the script will be selected to run)
- Click the PLAY button and the script will run.Result Evaluation
Result can be analyzed from result status bar. If script is passed then Failure=0 and Run = 1 (in case one test script is run at a time). If script is passed then Failure=1 and Run = 0.Steps to run Advanced scripts
- Download and install Nunit, JRE 1.5 or later, Visual Studio and Mozilla Firefox.
- Download Selenium RC server.
- Configure dot net client drivers (as specified below)
- Copy and paste the advanced script into the class1 created in Visual studio in step 3.
- Click f6 to Build.
- Now open command prompt.
- Navigate to the location where Selenium RC is downloaded.
e.g. if it is located in ‘E’ drive then go to: “E:\selenium-remote-control-1.0.3\selenium-server-1.0.3”- In the command prompt run the command. “java -jar selenium-server.jar”. (Don’t close the command prompt)
- Open Nunit.
- Go to File > Open Project
- Navigate to the Visual Studio 2008 > Projects > Selenium Project > Selenium Project > Bin > Debug.
- Select Selenium Project.dll.
- In Nunit click ‘Run’.
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 when the test case is completed..NET client driver configuration
.NET client Driver can be used with Microsoft Visual Studio. To configure it with Visual Studio do as Following.1. Launch Visual Studio and navigate to File > New > Project.2. Select Visual C# > Class Library > Name your project > Click on OK button.3. A Class (.cs) is created. Rename it as appropriate.Under right hand pane of Solution Explorer right click on References > Add References.4. Select following dll files - nmock.dll, nunit.core.dll, nunit.framework.dll,ThoughtWorks. Selenium.Core.dll, ThoughtWorks.Selenium.IntegrationTests.dll, ThoughtWorks.Selenium.UnitTests.dll and click on Ok button.
Friday, May 3, 2013
Selenium Introduction
What is Selenium?
Selenium
is a open source automated testing tool for web applications across
different browsers and platforms. It
is using that Selenium focuses on automating web-based applications.
Selenium
is not just a single tool but have a suite of softwares, It
has four components.
- Selenium Integrated Development Environment (IDE)
- Selenium Remote Control (RC)
- WebDriver
- Selenium Grid
Birth of Selenium Core
Primarily,
Selenium was created
by Jason Huggins in 2004.
, he was working on a web application that required frequent testing.
Having realized that the repetitious manual testing of their
application was becoming more and more inefficient, he created a
JavaScript program that would automatically control the browser’s
actions. He named this program as the “JavaScriptTestRunner.”
Birth of Selenium Remote Control (Selenium RC)
Testers
using Selenium Core had to install the whole application under test
and the web server on their own local computers, because have the
some restrictions by the same
origin policy. So
, Paul
Hammant,
decided to create a server that will act as an HTTP proxy to “trick”
the browser into believing that Selenium Core and the web application
being tested come from the same domain. This system is known as
the Selenium
Remote Control .
Birth of Selenium Grid
Selenium
Grid was developed by Patrick
Lightbody to
address the need of minimizing test execution times as much as
possible. He initially called the system “Hosted
QA.”
It was capable of capturing browser screenshots during significant
stages, and also of sending
out Selenium commands to different machines simultaneously.
Birth of Selenium IDE
Selenium
IDE,
a Firefox extension that can automate the browser through a
record-and-playback feature. He came up with this idea to further
increase the speed in creating test cases.
Birth of WebDriver:
Simon
Stewart created
WebDriver , when
browsers and web applications were becoming more powerful and more
restrictive with JavaScript programs like Selenium Core.
It
was the first cross-platform testing framework that could control the
browser from the OS level.
Brief
Introduction Selenium IDE
Selenium
Integrated Development Environment (IDE) is the simplest
framework in
the Selenium suite and is the
easiest one to learn.
It is a Firefox
plugin that
you can install as easily as you can with other plugins. However,
because of its simplicity, Selenium IDE should only be used as
a prototyping
tool.
If you want to create more advanced test cases, you will need to use
either Selenium RC or WebDriver.
Brief Introduction Selenium Remote Control (Selenium RC)
Selenium
RC was the flagship
testing framework of
the whole Selenium project for a long time. This is the first
automated web testing tool that allowed
users to use a programming language they prefer.As
of version 2.25.0, RC can support the following programming
languages:
- Java
- C#
- PHP
- Python
- Perl
- Ruby
Brief Introduction WebDriver
The
WebDriver proves itself to be better
than both Selenium IDE and Selenium RC in
many aspects. It implements a more modern and stable approach in
automating the browser’s actions. WebDriver, unlike Selenium RC,
does not rely on JavaScript for automation. It
controls the browser by directly communicating to it.
The
supported languages are the same as those in Selenium RC.
- Java
- C#
- PHP
- Python
- Perl
- Ruby
Selenium Grid
Selenium
Grid is a tool used
together with Selenium RC to run parallel tests across
different machines and different browsers all at the same time.
Parallel execution means running multiple tests at once.
Features:
- Enables simultaneous running of tests in multiple browsers and environments.
- Saves timeenormously.
- Utilizes the hub-and-nodes concept. The hub acts as a central source of Selenium commands to each node connected to it.
Subscribe to:
Posts (Atom)

