Showing posts with label QTP FAQ's. Show all posts
Showing posts with label QTP FAQ's. Show all posts

Friday, June 5, 2009

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.

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.

Tuesday, June 2, 2009

Basics Questions Asked in QTP ?

Full form of QTP ?

Quick Test Professional

What’s the QTP ?

QTP is Mercury Interactive Functional Testing Tool.

Which scripting language used by QTP ?

QTP uses VB scripting.

What’s the basic concept of QTP ?

QTP is based on two concept-
* Recording
* Playback

How many types of recording facility are available in QTP ?

QTP provides three types of recording methods-
* Context Recording (
Normal)
* Analog Recording
* Low Level Recording

How many types of Parameters are available in QTP ?

QTP provides three types of Parameter-
* Method Argument
* Data Driven
* Dynamic

What’s the QTP testing process ?

QTP testing process consist of seven steps-
* Preparing to recoding
* Recording
* Enhancing your script
* Debugging
* Run
* Analyze
* Report Defects

What’s the Active Screen ?

It provides the snapshots of your application as it appeared when you performed a certain steps during recording session.

What’s the Test Pane ?

Test Pane contains Tree View and Expert View tabs.

What’s Data Table ?

It assists to you about parameterizing the test.

What’s the Test Tree ?

It provides graphical representation of your operations which you have performed with your application.

Which all environment QTP supports ?

ERP/ CRM
Java/ J2EE
VB, .NET
Multimedia, XML
Web Objects, ActiveX controls
SAP, Oracle, Siebel,
PeopleSoft
Web Services, Terminal Emulator
IE, NN, AOL

How can you view the Test Tree ?

The Test Tree is displayed through Tree View tab.

What’s the Expert View ?

Expert View display the Test Script.

Which keyword used for Nornam Recording ?

F3

Which keyword used for run the test script ?

F5

Which keyword used for stop the recording ?

F4

Which keyword used for Analog Recording ?

Ctrl+Shift+F4

Which keyword used for Low Level Recording ?

Ctrl+Shift+F3

Which keyword used for switch between Tree View and Expert View ?

Ctrl+Tab

What’s the Transaction ?

You can measure how long it takes to run a section of your test by defining transactions.

Where you can view the results of the checkpoint ?

You can view the results of the checkpoints in the Test Result Window.

What’s the Standard Checkpoint ?

Standard Checkpoints checks the property value of an object in your application or web page.

Which environment are supported by Standard Checkpoint ?

Standard Checkpoint are supported for all add-in environments.

What’s the Image Checkpoint ?

Image Checkpoint check the value of an image in your application or web page.

Which environments are supported by Image Checkpoint ?

Image Checkpoint are supported only Web environment.

What’s the Bitmap Checkpoint ?

Bitmap Checkpoint checks the bitmap images in your web page or application.

Which enviornment are supported by Bitmap Checkpoints ?

Bitmap checkpoints are supported all add-in environment.

What’s the Table Checkpoints ?

Table Checkpoint checks the information with in a table.

Which environments are supported by Table Checkpoint ?

Table Checkpoints are supported only ActiveX environment.

What’s the Text Checkpoint ?

Text Checkpoint checks that a test string is displayed in the appropriate place in your application or on web page.

Which environment are supported by Test Checkpoint ?

Text Checkpoint are supported all add-in environments

Note:

* QTP records each steps you perform and generates a test tree and test script.

* QTP records in normal recording mode.

* If you are creating a test on web object, you can record your test on one browser and run it on another browser.

* Analog Recording and Low Level Recording require more disk sapce than normal recording mode.