Technical Interview Questions on QTP

Here is the exhaustive list of questions on QTP which are asked or can be asked in QTP Technical interview. Prepare them well and I certainly hope you will come out with flying colors. All the Best!
What is Test Frame Work?
How comfortable are you in VB Scripting?
What is Description Object?
What are SetToProperty, SetRoProperty, GetToProperty scripting?
What is the difference between version 6.5 and 8.2?
What is the difference between Normal mode and Fast mode?
How do you invoke the application through QTP?
How do you close the Task Manager through QTP?
How will you load the object during run time?
How will you handle the situation when object is not captured during record?
What is test object?
How QTP recognizes the objects stored in object repository
What is post recovery scenario?
What is reusable action and how the same can be implemented (process)
How will u integrate oracle with QTP
How QTP integrate with application
What is object repository?
What are all the fields present in object repository?
What is smart identification?
What are the mandatory properties for a text box (scenario?)
What is Checkpoint?
What is object?
What are the properties of object?
What is Action?
What will be there in Keyword view and Expert View?
What is regular expression how will u implement it
Where the checkpoints are stored
What is database checkpoint, how will u parameterize the database from separate data table
How will u handle application crash using recovery scenario manager (Step By Step Process)
What is Virtual Object?
What is the difference between calling a function and reusing an action?
How QTP support all types of applications (Platforms)
What is the difference between application testing and product testing?
What is throw object?
What is Run-time Data?
How will you enhance the script?
Can objects recogonised without repository?
Where did u automate in ur project
Any challenge that faced in ur project
Batch test,run action
Purpose of automation
Diff ways of parameterising
Error handled other than recovery scenario manager
Diff betw WR and QTP
What kind of errors can b handled?
How you used DDT in QTP?
Difference between keyword driven test and DDT?
How did you use regular expression in QTP and also in Win Runner?
How do you learn the object in QTP?
How will you handle custom object in QTP?
Differences in QTP and Win Runner.
Give us the Definition for Integration Testing, Regression Testing System Testing
How will you report the bug and explain the defect tracking Sheet you handled?
What In-string function will do?
What is L-trim function will do?
WinRunner and QTP difference?
In website, protocol has been changed http: to https what you will do? Tell me your Approach?
What Framework you are following?
How to load the object repository at run time?
How much strong on VB and C?
How to compare the 2 strings?
What is the Silent mode in WinRunner?
Have you worked with Quality Center?
Have you used Test Director?
What is QTP Test Frame work?
Definitions for Keyword view and Tree View?
What is Smart Identification?
What is Object Repository?
What is your experience level in QTP?
What is your Role and Responsibilities In QTP with your current organisation?
Explain the following:
Import and Export of files.
Random testing of 500 test cases.
Invoking of application
Opening notepad in QTP &Writing of Test Result in Notepad.
Merging of Two Repositories
Datafile / Verification of data file when file is not available in local system.
Business process component / Types and usage.
Opening of notepad in QTP to write and execute the coding.
How to find local host name using QTP
How to handle exception when data table is not available in local host system or Path is not correct (Explain Statement with example)
Runtime dynamic settings.
Script generated after applying database check point.
Script generated at the time of setting runtime property.
Types of exception handling and script for that.
Scripting


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.


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.