Monday, November 28, 2011

Object Identification Process

Object Identification:

How does QTP identifies the objects ?

QTP has a unique procedure to identifies the object, as per my expereince I feel this separts QTP from rest of the tool.
There are three ways by which QTP Identifies the Object in the Object Repository(OR) and they are :
-Mandatory Properties & Assistive properties
-Ordinal Identifiers
-Smart Identification

What is Mandatory properties and Assistive properties..?


These are the property which we give in Initial stage of Identifying the objects, like the name, title and Url properties for Browser Class. These are the basic properties which QTP uses to identifiy the objects in the application.The Mandatory and Assistive properties can selected after analysing the unqine property/properties by which the objects can be identified easily without any confilct. We can selet which properties should be madatory and assitive property.

Tool --> Object Identification...

Object Identification Window opens. Select the property/properties which is required by clicking 'Add/Remove' button then click 'OK'.
You can select the Oridinal identifier and Enable Smart Identification here itself.

Ordinal Identifiers:

Ordinal Identifier are the unique numerical value which QTP assigns for objects class in order to identify them. Ordinal Identifiers comes in object process when the Manadatory and assistive properties fails to identify the object. Ordinal Identifiers cannot be viewed using Spy.

 There are three types of Ordinal Identifiers
- Index
- Location
- Creation Time
Index : Index property are the numerical value generated by QTP for the object class. The starting value of index is Zero.
Location : Location Property are the numerical value of the objects which are in the The starting value of index is Zero.parent Window/browser, Frame and other objects.
Creation Time: This Ordinal Identifier is specifically for Browser class objects only. Numerical values are generated in the order in which the browsers are opened.

Smart Identification:


Smart Identification is used when QTP fails to identifies the object using Manadotry & Assative properties and ordinal Identifiers. Smart Identification uses two types of properties and they are Base Filter Properties and Optional Filter Properties.
Base Filter Properties:Base filter properties are the basic and fundamental properties of the object which cannot be changed without changing the object itself.
Optional Filter Properties:These are the properties which are  the remaining other properties which are unlikely to change frequently.

Object Identification Process:

Click here for more details

Monday, October 3, 2011

Object and Object Repositories

Object and Object Repositories

Objects:

        In QTP all the elements are saved in script as objects. Objects are combination of properties which are unique in Nature. Objects are composed of types and properties. Each object will have its set of properties to identify its object uniquely in the Application. For example, for a  text box its type is text box and property is to write any text in it. At the time of execution , QTP identifies the objects on the screen by comparing them with the objects and their properties in the Repository.


Mostly used objects in QTP(I will be discussing based on Web application only)
Browser
Page
Links
List Box
Radio Button
Web Table
Frame
Image

Web Edit
and so on..

There are two types of object in QTP:

1. Test Objects
    Object stored in object repository are called Test objects.
2. Run Time Objects
    Objects which are identified in run time (i.e Dynamic)are called Run Time Objects.




Object Spy:


Object spy is used to know the object information which are properties and values of the object, the methods associated to it and Object Spy will also display the object's hierarchy(i.e Structured view of objects). We can get the properties and methods by selecting the object required by the Pointer in Object spy. We can use Object spy for both Run Time and Test Objects.

Note: In earlier versions of QTP we can only view the objects information from Object spy, From QTP 11 we can add objects to the OR directly from object Spy.




Object Repositories (OR):

Collection of objects pertaining to the application under test(AUT) are called Object Repositories.

Types of Object Repository
In QTP there are two types of object Repository and they are
    - Per Action object repository(Local Object Repository)
    - Shared Object Repository

Per Action Object Repository:

Which is also called as local object repository. This is the default Repository of QTP and saved within the action itself.This Object Repository Specific to actions (Will be used only for a particular action). This OR is preferable when application is not dynamic with respect to time. Per Action Object Repository cannot be reused.
 
File Type:
Per Action Repository's extension is .bdb

Shared Object Repository:

The collection of Objects which are stored in a file (with extension of.tsr) that can be accessed by multiple users at the same time,
is known as Shared object repository. By Default ,Shared Object Repository is opened in Read-only mode. To enable editing click File (QTP Toolbar) > Enable Editing Shared object repository occupies less memory than the local object repository.
 
File Type:
Shared Object Repository's extension is .tsr

How to make a Object Repository as Shared OR ?

To make an object Repository as Shared Object Repository open the Object Repository i.e
Resources --> Object Repository
Then go to File in the Object Repository and then Export Local Object
i.e File -->Export Local Objects
After that save the repository where you want to maintain the file with extension '.tsr'


Check out for Object Identification here

Thursday, September 8, 2011

TESTING PROCESS IN QTP


TESTING PROCESS IN QTP

1. Create Test Plan
2. Generate the Tests
3. Enhance the Tests
4. Debug the Tests
5. Run the Tests
6. Analyze Test Results
7. Report Defects

1) Create Test Plan
The First step in the QTP testing Process is Creating Test Plan. Here we analyze the Application Under Test (AUT) and create Test plan for Automation testing. After that, we select the Test cases for Automation. Once the test cases are selected we prepare the test data and if required configure the QTP according to our requirements.

2) Generating Tests/scripts and Enhancing Tests
The next step is Generating the Tests/Scripts (scripts are called tests in automation testing, Will be using Test henceforth). Tests can be prepared either by recording (mostly not recommended) or by scripting using VBScript, QTP supports only VB scripting. In Generation of Tests itself, we will create Object Repository and add the required object to it. We use descriptive programming (will discuss about Descriptive programming in detail in my later post) when required. 
   Once the generation of Tests is done, the next step is to enhance the test. While Enhancing the test we insert checkpoints, output Values, add comments to the steps, and insert Synchronization, Parametrization and calling the Actions (Reusable) and functions.

 3) Debugging Tests
 After enhancing the tests, we debug the test to check its efficiency. Here we use multiple debugging options like breakpoints, watch, debug Viewer (debugging comments present in QTP).  

 4) Running Tests
 These tests are finally executed using several modes: Normal Execution, Batch Execution, executing tests from framework. 

 5) Analyzing Results
 After the Test execution, QTP automatically opens the result Window. Here we filter the results (depending what is required whether we need only the passed and Failed results or etc), Export the results to Shared folder where everyone can have access.

6) Reporting Defects
 If we find any defects after the execution of our Tests, the next step in QTP process is to report the defects. We can report manually or we can even mail our results directly to the concerned person. On the other hand, we can also log the defects directly in Quality Center Tool.

Friday, August 26, 2011

INTRODUCTION TO QTP

Quick Test Professional is a functional and regression test automation software tool developed by Mercury Interactive. Currently owned by HP and commonly known as HP Quick test professional.
  QTP is a Record and playback tool(recording not preferred always) as well as Programmatic tool which uses VbScripting for scripting. QTP Supports technologies depending upon the Version of the tool, Web, Java, .Net, SAP, Oracle, Siebel, PeopleSoft, Delphi, Power Builder, Flex, Sliver light.
QTP is a licensed tool it comes with a trail version.
Latest QTP version is 11.0 - Released in 2010.

Advantages of QTP

1. Ease of use.

2. Use of VBScript, which makes QTP significantly easier for a non-programmer person to understand and create Test case / scripts.

3. Object identification mechanism is better.

4. Technology support is good. The supported technologies, depending on the QTP version, are available for Web, Java(Core and Advanced), .Net, WPF, SAP, Oracle, Siebel, PeopleSoft, Delphi, Power Builder, Stingray 1, Terminal Emulator, Flex, Web Services, Windows Mobile, VisualAge Smalltalk, Silverlight and mainframe terminal emulators.

5. Various Parameterization types in QTP, which ease the test cases for the same operations with multiple sets of data.

6. QTP Supports Framework like modular, Keyword, data driven and Hybrid.

7. Handling Dynamic objects are possible with use of Descriptive programming.

8. QTP Reports are clear and easily understand.
 
Disadvantages or drawbacks of QTP

1. QTP works only on Windows OS thereby becoming Platform dependent tool.

2. Poor support for cross browser testing. Supports only IE and little version of Firefox.

3. License and maintenance cost is high.


4. QTP consumes more memory.

5. In QTP you cannot work on multiple scripts at a time like in winrunner.


6. CPU utilization is more in QTP.

Major Topics in QTP:

-Testing Process

-Object and Object Repositories

-QTP Recording

-Actions

-Parameterization

-Check Points

-VB Scripting

-Descriptive Programming

-Synchronization

-File system Objects

-Frameworks

Will be explaining each topics in my upcoming posts.

Monday, August 1, 2011

Test Automation Tools

Automation Tools are available in two types, Open Source(Free) and Licensed. Below, I have listed few Test Automation tools which are used widely across the Testing Industry.




FromHP
VersionLicensed
Websitehttp://www8.hp.com/us/en/software/enterprise-software.html
HP QuickTest ProfessionalOSWindows 2000,Windows XP,Windows 2003 Server,Windows 7
BrowsersIE8 and FF3.6. IE9
Supported ApplicationWeb,windows and below given technologies
TechnologyWeb, Java(Core and Advanced), .Net, WPF, SAP, Oracle, Siebel, PeopleSoft, Delphi, Power Builder, Stingray 1, Terminal Emulator, Flex, Web Services, Windows Mobile, VisualAge Smalltalk, Silverlight and mainframe terminal emulators




FromThoughtWorks Studios
VersionOpen Source
Websitehttp://seleniumhq.org/
Selenium OSWindows,Linux,Solaris
Browsersfirefox(Record & Playback);IE8,7(RC & Core);Safari2,3(RC & Core);Opera9,8(RC & Core)
Supported ApplicationWeb
TechnologyC#,Java,Perl,PHP,Python,Ruby




FromIBM
VersionLicensed
Websitehttp://www-01.ibm.com/software/awdtools/tester/functional/
IBM Rational Functional TesterOSWindows,Linux
Browsers
Supported ApplicationSeibel and SAP applications,Adobe Flex technology
TechnologySeibel,SAP,Adobe Flex technology




FromIBM
VersionLicensed
Websitehttp://www-01.ibm.com/software/awdtools/tester/robot/

Rational robot
OSWindows XP,ME, 2003, 2000, 98 or Windows NT.
Browsers
Supported Applicatione-commerce, client/server and ERP applications
TechnologyHTML and DHTML, Java™, VS.NET, Microsoft Visual Basic and Visual C++, Oracle Developer/2000, PeopleSoft, Sybase PowerBuilder and Borland Delphi. For advanced testing of Java. VS.NET and Web-based applications, as well as of 3270 (zSeries™) and 5250 (iSeries™) terminal-based applications





FromBorland
VersionLicensed
Websitehttp://www.borland.com/us/products/silk/silktest/
 SilkTestOSWindows XP,Vista,7
BrowsersFirefox 3.5,3.6;IE 6,7,8
Supported Application
TechnologyAdobe Flex,Java 1.6,.NET,SAP,SQL,Oracle




FromSmartBear Software
VersionLicensed
Websitehttp://smartbear.com/products/qa-tools/automated-testing/
 TestCompleteOSWindows 7, Vista, XP, Windows Server 2003 and 2008
BrowsersFirefox 3.5—4.0,IE6—9
Supported ApplicationWindows and Web testing
Technology.NET, WPF, ASP.NET, Silverlight and XBAP




FromMicrosoft
VersionLicensed
Websitehttp://www.microsoft.com/visualstudio/en-us/products/2010-editions/test-professional/overview

Visual Studio Test Professional
OSWindows
BrowsersIE7/IE8,FireFox 3.5 and 3.6
Supported Application
TechnologyHTML,AJAX,SharePoint




FromTyto Software
VersionOpen Source, Licensed
Websitehttp://sahi.co.in
 SAHIOS
BrowsersInternet Explorer, Mozilla Firefox, Google Chrome, Opera and Safari
Supported ApplicationWeb
Technology





From
VersionOpen Source
Websitehttp://watir.com/
WATIR OSWindows,Linux
BrowsersInternet Explorer, Mozilla Firefox, Google Chrome, Opera and Safari
Supported ApplicationWeb
Technology


Reference: Internet

Thursday, July 28, 2011

Introduction To Automation Testing

What is Automation Testing
Test automation is the use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control and test reporting functions. Commonly, test automation involves automating a manual process already in place that uses a formalized testing process.

Test automation involves automating a manual process already in place that uses a formalized testing process.

Benefits of Automation

Reliable: Tests perform precisely the same operations each time they are run, thereby eliminating human error.
Repeatable: You can test how the software reacts under repeated execution of the same operations.
Programmable: You can program sophisticated tests that bring out hidden information from the application.
Comprehensive: You can build a suite of tests that covers every feature in your application.
Reusable: You can reuse tests on different versions of an application, even if the user interfaces changes.
Better Quality Software: Because you can run more tests in less time with fewer resources
Fast: Automated Tools run tests significantly faster than human users.
Cost Reduction: As the number of resources for regression test are reduced.
Other: Test without any human interaction
Load and Stress testing

Why Automation is required? 
Ø       Reducing test time and resources
Ø       Consistent Test Procedures
Ø       Ensures process repeatability and resource independence
Ø       Eliminates errors of manual testing
Ø       Improves efficiency of testing
Ø       Reducing Testing costs
Ø       Gives consistent and accurate results
When to automate? 
Ø       Regression testing
Ø       Data-driven testing
Ø       The Application under manual test is stable
Ø       Application which has long runs
Regression Testing: Regression test suite is the best candidate for automation. If testing only needs for short period projects, it should be done manually.  If the test suite needs to be run for a long time, regularly for every iteration, build and after bug fixing, then it should be automated.  Always automate Smoke testcases then Sanity testcases and then regression.
Data-driven testing: Single test to verify multiple data like want to test application with various users.
The Application under manual test is stable: We cannot automate application which is unstable i.e when the functionality of application keeps on changing.
Long Run Projects: Long run projects are good to go with automation. Automating short duration project does not make sense. I personally go for automation for those projects whose duration is more than 6 months.  

When to NOT Automate?
Ø      Functionality of the application changes frequently
Ø      Project doesn’t have enough time
Ø      Test with unknown results cannot be automated.