Parameterization In QTP

Parameterization is the process of substituting values for dynamic parameters from a CSV(Comma separated values) file or from the Database.
For example, when testing a web application that contains a login page, “parameterization” lets you use a different login name and password for each virtual user (dynamic substitution of values). There’s no need for each User Scenario to contain a separate script that performs the task of logging in. Similarly, you can parameterize the cookies and other headers passed in the request header such as Scheme, Proxy-Connection, etc. You can also parameterize the parameters passed with the URL string.
In this example suite, the user name and password are dynamically substituted from the csv file. For this purpose, a data.csv file is created and placed under /projects/WebPerformanceDemo/usersrc folder. The csv file contains 100 usernames and password starting from emp1 to emp100. Hundred logins should be populated in the application’s database. This is done using the following steps:
Click the ‘Edit’ link under HTTP Parameters adjacent to a recorded transaction in the load test screen. This will invoke the Parameterization screen. The recorded URLs will be loaded in the left-side panel.
Select the URL used for logging into the application.
Choose the Parameters tab. The parameters for the URL will be shown in a table.
In the table, look for the parameter with the name ‘userpass’. From the Fetch Data From column corresponding to the row, click the arrow in the button and select the parameterize type as ‘Dataset’. Configure the dataset to fetch the values from CSV and click the Apply button.
The Value column will display the configured dataset value.
Similarly, select the parameter ‘username’ and configure the data source for the same.
The above steps will use the same script with 100 different usernames and password to login and simulate the load of 100 virtual users.
How many ways we can parameterize data in QTP?
There are four types of parameters:
Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test.
Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, QuickTest uses a different value from the Data Table.
Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that QuickTest generates for you based on conditions and options you choose.
There are three types of environment variables:
User-defined internal. Variables that you define within the test. They are saved with the test and accessible only
within the test in which they were defined.
User-defined external. Variables that you predefined in the active external environment variables file. These variables are read-only in this context.
Built-in. Variables that represent information about the test and the computer on which the test is run, such as Test path and Operating system. These variables are accessible from all tests, and are designated as read-only
Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have QuickTest generate a random number and insert it in a number of tickets edit field.
Parameterization is the process of substituting values for dynamic parameters from a CSV(Comma separated values) file or from the Database.
For example, when testing a web application that contains a login page, “parameterization” lets you use a different login name and password for each virtual user (dynamic substitution of values). There’s no need for each User Scenario to contain a separate script that performs the task of logging in. Similarly, you can parameterize the cookies and other headers passed in the request header such as Scheme, Proxy-Connection, etc. You can also parameterize the parameters passed with the URL string.
In this example suite, the user name and password are dynamically substituted from the csv file. For this purpose, a data.csv file is created and placed under /projects/WebPerformanceDemo/usersrc folder. The csv file contains 100 usernames and password starting from emp1 to emp100. Hundred logins should be populated in the application’s database. This is done using the following steps:
Click the ‘Edit’ link under HTTP Parameters adjacent to a recorded transaction in the load test screen. This will invoke the Parameterization screen. The recorded URLs will be loaded in the left-side panel.
Select the URL used for logging into the application.
Choose the Parameters tab. The parameters for the URL will be shown in a table.
In the table, look for the parameter with the name ‘userpass’. From the Fetch Data From column corresponding to the row, click the arrow in the button and select the parameterize type as ‘Dataset’. Configure the dataset to fetch the values from CSV and click the Apply button.
The Value column will display the configured dataset value.
Similarly, select the parameter ‘username’ and configure the data source for the same.
The above steps will use the same script with 100 different usernames and password to login and simulate the load of 100 virtual users.

How many ways we can parameterize data in QTP?
There are four types of parameters:
Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test.
Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, QuickTest uses a different value from the Data Table.
Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that QuickTest generates for you based on conditions and options you choose.
There are three types of environment variables:
User-defined internal. Variables that you define within the test. They are saved with the test and accessible only within the test in which they were defined.
User-defined external. Variables that you predefined in the active external environment variables file. These variables are read-only in this context.
Built-in. Variables that represent information about the test and the computer on which the test is run, such as Test path and Operating system. These variables are accessible from all tests, and are designated as read-only Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have QuickTest generate a random number and insert it in a number of tickets edit field.


How to add objects to the object repository (QTP 9.0)?

Adding objects to a local object repository:

An object can be added to the local object repository in one of the following ways:

1. Record some actions on the object; this will automatically add this object to the object repository. If you do not need the recorded statements in your script, you can delete them and it will not remove the added object from the object repository.

2. Add objects manually.

1. Go to Resources -> Object Repository.

2. In the Filter combobox, select “Local Objects.”

3. Go to Object -> Add Objects to Local.

4. Click on the object to be added to the repository.

5. If the Object Selection window appears, select the desired object, and click .

6. If the Add Object to Object Repository window appears, select the appropriate option:

To add only the selected object, select the “Only the selected object” radio button. To add the selected object and its child objects of a specified type, select the “Selected object and its descendants of type” radio button. Then, select the checkbox next to the child object types that should be added.

7. Click .

3. Manually define a new test object.

1. Go to Resources -> Object Repository.

2. In the Filter combobox, select “Local Objects.”

3. Go to Object -> Define New Test Object.

4. Select the appropriate Environment for your test object. For example, to add a Link object, select “Web.”

5. Select the desired test object class for the new object.

6. Enter a name for your test object.

7. Fill in the Test object details as needed. The Test object details area automatically contains the mandatory properties defined for the object class in the Object Identification dialog box. You can add or remove properties as required, and define values for the properties.

To add properties, click the “Add description properties” button (with the + icon). Select the properties to be added and click .
To remove properties, select the properties to be removed, and click the “Remove selected description properties” button (with the X icon)

8. Click to add the new object.

9. Repeat steps d through h as needed.

10. When done, click .

Note:
When you manually define an object, QuickTest Professional will not automatically add the object’s parent. If the parent objects are not present, you will need to define them as well. Once the objects are added to the repository, you can drag-and-drop them to their appropriate positions.

4. Add the object using the Active Screen.

1. In the Active Screen, right-click on the object to be added.

2. Select “View/Add Object.”

3. If the Object Selection window appears, verify the desired object is selected, and click .

4. In the Object Properties window, click .

Adding objects to a shared object repository:
An object can be added to a shared object repository in one of the following ways:

1. From a local repository.
2. Add objects manually.

1. Go to Resources -> Object Repository Manager.

2. Go to File -> Open -> .

3. By default the repository will open in read-only mode. Go to File -> Enable Editing.

4. Go to Object -> Add Objects.

5. Click on the object to be added to the repository.

6. If the Object Selection window appears, select the desired object, and click .

7. If the Add Object to Object Repository window appears, select the appropriate option:

To add only the selected object, select the “Only the selected object” radio button. To add the selected object and its child objects of a specified type, select the “Selected object and its descendants of type” radio button. Then, select the checkbox next to the child object types that should be added.

8. Click .

3. Manually define a new test object.

1. Go to Resources -> Object Repository Manager.

2. Go to File -> Open -> .

3. By default the repository will open in read-only mode. Go to File -> Enable Editing.

4. Go to Object -> Define New Test Object.

5. Select the appropriate Environment for your test object. For example, to add a Link object, select “Web.”

6. Select the desired test object class for the new object.

7. Enter a name for your test object.

8. Fill in the Test object details as needed. The Test object details area automatically contains the mandatory properties defined for the object class in the Object Identification dialog box. You can add or remove properties as required, and define values for the properties.

To add properties, click the “Add description properties” button (with the + icon). Select the properties to be added and click .
To remove properties, select the properties to be removed and click the “Remove selected description properties” button (with the X icon)

9. Click to add the new object.

10. Repeat steps d through h as needed.

11. When done, click .

Note:
When you manually define an object, QuickTest Professional will not automatically add the object’s parent. If the parent objects are not present, you will need to define them as well. Once the objects are added to the repository, you can drag and drop them to their appropriate positions.

4. Merge with another shared object repository.


Diff between Image check-point and Bit map Check point in QTP ?


What is the Diff between Image check-point and Bit map Check point?
Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. QuickTest captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.

There are four types of parameters:
Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test.

Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, QuickTest uses a different value from the Data Table.

Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that QuickTest generates for you based on conditions and options you choose.

Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have QuickTest generate a random number and insert it in a number of tickets edit field.

 

 

Explain about the Test Fusion Report of QTP? – Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.

 

What is the use of Text output value in QTP? – Output values enable to view the values that the application talks during run time. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.

 

In how many ways we can add check points to an application using QTP? – We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording).

 

What are the properties you would use for identifying a browser & page when using descriptive programming?

         Name would be another property apart from title that we can use

 

Explain in brief about the QTP Automation Object Model. – Essentially all configuration and run functionality provided via the Quick Test interface is in some way represented in the Quick Test automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in Quick Test have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods. You can use the objects, methods, and properties exposed by the Quick Test automation object model, along with standard programming elements such as loops and conditional statements to design your program


Feature Comparison Between QTP vs WR

Feature Comparison:

 

*    Common features found in both WinRunner and QuickTest Pro:

Record/Replay

ODBC & Excel Connectivity

Code Editor & Debugger

Recovery Manager

Shared Object Repository

Rapid Object Import

Numerous Checkpoints

Analog

Script & Function Libraries

 

 

*    WinRunner Only Environments:

Function Generator

Database Integration

Run Wizard

TSL

MDI

 

 

*    QuickTest Pro Only Environments:

ActiveScreen

TestGuard

Tree View

ScriptFusion

Data Table

VBScript

Function Generator*

(coming in v7.0)

Run Wizard*

(coming in v7.0)


Environment Coverage Comparison WR vs QTP

Environment Coverage Comparison:

 

*    Common environments shared by both WinRunner and QuickTest Pro:

Web-Related Environments

IE, Netscape, AOL

 

JDK, Java Foundation Classes, AWT

 

Symantec Visual Café

 

ActiveX Controls

ERP/CRM

Oracle: Jinitiator, 11i, NCA

Custom Client Server

Windows

 

C++/C

 

Visual Basic

Operating Systems

Windows 98, 2000, NT, ME, XP

Legacy

3270, 5250 Emulators

 

VT100

 

*    WinRunner Only Environments:

Custom Client/Server

PowerBuilder

 

Forte

 

Delphi

 

Centura

 

Stingray

 

SmallTalk

ERP/CRM

Baan

 

PeopleSoft Windows

 

Siebel 5, 6 GUI Clients

 

Oracle GUI Forms

 

*    QuickTest Pro Only Environments:

ERP/CRM

SAP

 

Siebel 7.x

 

PeopleSoft 8.x

.Net

WinForms

 

WebForms

 

.Net controls

Web Services

XML, HTTP

 

WSDL, SOAP

 

J2EE, .Net

Multimedia

RealAudio/Video

 

Flash