Automation – QTP

Introduction To QTP

• Recap.
• Features of QTP.
• Descriptive Programming.
• Objects and Their Identification.
• Areas That Can be automated:
• Highly redundant tasks or scenarios.
• Repetitive tasks that are boring or tend to cause human error
• Well-developed and well-understood use cases or scenarios first
• Relatively stable areas of the application over volatile ones must be automated.
• Type of Tests that can be automated.
• Functional -testing that operations perform as expected.
• Regression -testing that the behavior of the system has not changed.
• Exception or Negative -forcing error conditions in the system.
• Performance -providing assurance that the performance of the system will be adequate for both batch runs and online transactions in relation to business projections and requirements.

Features Of QTP
Active Screen: Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.
Keyword View: The Keyword View enables you to create and view the steps of your test or component in a keyword-driven, modular, table format. Each step in your test or component is a row in the Keyword View, comprised of individual parts which you can easily modify.
Expert View: In the Expert View, QuickTest displays each operation performed on your application in the form of a script,
comprised of VBScript statements. The Expert View is a script editor with many script editing capabilities
Data Table—Assists you in parameterizing your test or component. For a test, the Data Table contains the Global tab and a tab for each action. For a component, the Data Table contains single tab.

• A checkpointis a verification point that compares a current value for a specified property with the expected value for that property.
• This enables you to identify whether your Web site or application is functioning correctly.

Types of Checkpoints
• Standard Checkpoint checks the property value of an object in your application or Web page. The standard checkpoint checks a variety of objects such as buttons, radio buttons, combo boxes, lists, etc. For example, you can check that a radio button is activated after it is selected or you can check the value
of an edit field.
• Image Checkpoint checks the value of an image in your application or Web page. Image checkpoints are supported for the Web environment
• Table Checkpoint checks information within a table.
For example, suppose your application or Web site contains a table listing all available flights from New York to San Francisco. You can add a table checkpoint to check that the time of the first flight in the table is correct.
• Text Checkpoint checks that a text string is displayed in the appropriate place in your application or on a Web page
• Page Checkpoint checks the characteristics of a Web page.
For example, you can check how long a Web page takes to load or whether a Web page contains broken links.
• Database Checkpoint checks the contents of a database accessed by your application.
• XML Checkpoint checks the data content of XML documents in XML files or XML documents in Web pages and frames

• We can handle the anticipated timing problems by synchronizing the test or component to ensure that QuickTest waits until the application is ready before performing a step.

Ways to Synchronize
1. Synchronization point. By Inserting a synchronization point. This will ensure that QuickTest will pause the test or component until the object property achieves the value.
2. By inserting Exist or Wait statements that instruct QuickTest to wait until an object exists or to wait a specified amount of time before continuing the test or component
3. By modify the default amount of time that QuickTest waits for a Web page to load.
4. Writing your own Synchronization Function.

Quality Center
• Quality center is a central repository of manual and automated tests, Build test cycles, Run tests and components, and report and track defects.
• Quality Center can also be used for creating reports and graphs, for review of test planning, test runs and defect tracking.

Object Repository
• QuickTest stores the object data in the object repository. This data is a set of properties of the objects.

Recovery Scenario Manager
• Recovery scenario manager helps to create recovery scenarios which will handle any interruptions that might occur during a test execution.

• A save confirmation dialog pops up during execution.

Understanding the Recovery Scenario Wizard
• The Recovery Scenario Wizard leads you, step-by-step, through the process of creating a recovery scenario. The Recovery Scenario Wizard contains five main steps:
1. Defining the trigger event that interrupts the run session
2. Specifying the recovery operation(s) required to continue
3. Choosing a post-recovery test run operation
4. Specifying a name and description for the recovery scenario
5. Specifying whether to associate the recovery scenario to the current test and/or to all new tests

Objects & Their Identification
• QTP is an object based programming environment.
• There are various objects within the windows environment. Browsers, Desktop Icons, files etc to quote a few.

Objects And QTP
1. What are the objects that we can interact with?
2. How can we uniquely identify an object.
3. What operations can we do to an object.

What are the objects that we can interact with?
• We can interact with all the GUI objects in the windows environment.

How can we uniquely Identify an Object?
• There are many GUI objects active in windows at any given time.
• We can uniquely identify the objects through its properties.
• We need to find out the set of properties which will uniquely identify an object.

Properties can be found out through.
• Probing.
• There is a tool in QTP known as an Object Spy which can be used to find out the set of properties of an objects
• Heuristics (previous knowledge and experience)

What Operations Can we do on an object?
• Read a property, Known as a Get operation.
• Set a property, Known as a Set operation.
• Trigger an Event. E.g. Click.

1. Set value in the username field on the login screen.
2. Read the value in the username field from the login screen.

Interacting with an Object-Steps
1. Object identification.
2. Specify the Operation.
For identifying the username field.
• Specify the Browser.
• Specify the Page.
• Specify the Object. i.e. the text box.

Browser is encapsulated within the Browser object. Hence it can be identified as
• Browser()
• Browser(“micClass:=Browser”)

The page is contained within the browser
• hence a page can be identified as.
• Browser(“micClass:=Browser”).Page(“micClass:=Page”)
• The username text box is listed in the page, it can be identified as.
• Browser(“micClass:=Browser”).Page(“micClass:=Page”).WebEdit(“name:= j_username”)

For setting the value in a WebEdit use the Set method.
• The Complete syntax is
• Browser(“micClass:=Browser”)Page(“micClass:=Page”).WebEdit(“name:=j_username”).Set “Abhilash”

Reading a Value
• sVariable=Browser(“micClass:=Browser”)Page(“micClass:=Page”).WebEdit(“name:= j_username”).GetRoProperty(“value”)

Escape Characters.
All special characters need to be stuffed with a backslash character
• Example:
• processClassIDs[0] to be stuffed as
• processClassIDs[0]


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s