Wednesday, June 4, 2008

What is Datatable

Data table assists you in parameterizing the test.
There are two type of Data tables are available in QTP.
1. Design time data table 2. Runtime Data table.

Design time Data table -

There are two type of data sheets available, they are 1. Global Data Sheet 2.Local Data Sheet
The Global Data Sheet contains the data that replaces parameters in each iteration of test.
Each time you add a new action to the test, a new action sheet (Local Sheet) added to the data table. It contained data, replaces parameter in only one iteration of the test.

Run time Data table -

During a run session, Quick test creates a runtime data table.
When the run session ends, the runtime data table closes, and the data table pane again displays the stored design time data table.
The final data from the runtime data table is displayed in the runtime data table in the test results window.

Mandatory - Assitive - Ordinal Identifier properties

Quick test identify the objects by learning the default property values is called mandatory properties.
Ex - attached text, native class, alt, html tag, image type.

If the mandatory properties are not sufficient to create a unique object description then Quick test uses Assistive properties of the object to identify uniquely.
Ex - Id

If the mandatory and assistive properties are not sufficient to create a unique object description then Quick test uses Ordinal identifier to create a unique description of the object.
Ex - index, location, creation time.

How to load the Object Repository

To load the object repository at runtime -
Write following script...

Set app=CreateObject("QuickTest.application")
app.test.settings.resources.ObjectRepositoryPath="Path of the Object Repository"


To load manually -

Goto Test-Settings-resources-select shared for Object Repository Type-Browse the required Object Repository.

What is Object Repository

Object Repository is a place where all recorded or added objects are stored.
When you record the application, recorded objects are stored in the Object Repository, in order to use them later.
Object Repository mainly identifies how it will recognize an object at the time of replay.
Object Repository displays a tree of all objects in the current component or in the current action or entire test (depending on the object repository mode you selected)
We can view or modify the test object description of any test in the repository or we can add new objects to the repository.
There are two types of Object Repositories : Per Action and Shared Action

When we are working in Object Repository, Per Action mode, Quick test creates a new object repository for each action.
When we are working in Object Repository, Shared Action mode, Quick test adds new objects to the object repository.
If we record operations on a object that already exists in the Shared Object Repository, Quick test uses the existing information, and does not add the object to the Object Repository.

How QTP Recognize the Objects in AUT

When we record the application, QTP interact with an object and stores Test object properties in its Object Repository.
When the test runs, QTP maps the Test Object properties with the Runtime Object properties.
If it successfully maps the runtime properties, then test passes.
If not, test fails.

Test Object Properties - are properties of an object in the Object Repository
Runtime Object Properties - are properties of an object in the application.

Runtime Object is the actual object to which a Test Object can be mapped.
It is the actual object present in your AUT.

Example -

Open a Notepad and add objects in Object Repository
Then write script in QTP...
Msgbox window("Notepad").GetTOProperty("height")
'It gives you empty message. Because you didn't add height in Object Repository.
'Now try this
Msgbox window("Notepad").GetROProperty("height")
'You will get the height of the notepad window.

For Test Object, you have to add the property then only it will show in the test object properties list.
But for Runtime Object, always all properties are available.

We can use SetTOProperty method to change the properties of the test object, But we cannot change the properties of the Runtime Object.

About Me

My photo
Hi all,I am Arun Singh Rajaputra. I am working as a Project Lead in a reputed organization in Hyderabad, AP, India. I have little bit knowledge on Quick Test Professional and like to share my knowledge to all through this blog.

Subscribe to get updates on this blog

Enter your email address:

NOTE

Some of the posts posted in this blog are collected and most of them have been prepared by me. If any one have objections regarding any copied posts. Please mail me so that I can take a necessary action on that post.