QTP Vs Selenium

An excellent article on QTP vs Selenium




A very informative article by Eddie : Click Here to read



Related Posts:
Selenium Tutorials
Selenium for Functional testing of web applications

How to face Interview Questions in QTP

Note – These are the General QTP Questions which are applicable to all QTP Versions.

Q. What are test objects?
Test objects are objects created and maintained by QTP in its object repository. Each test object has a name and a set of properties to uniquely identify the actual object in the application.


Q. how does QTP identifies the objects during the script run?
During script run QTP searches for a run-time object that has the similar description of the test object in the object repository.


Q. How can i check the properties of an object in an application without using checkpoints? For Example how will you check whether a button is enabled?
Answer: GetROProperty method is used to retrieve the properties of the object in an application.It is very useful method and can be used to retrieve almost any of the property that can be seen while spying the object with object spy. For Example‘To get whether button is enabled or not.

Val = Browser("QA Friends").Page("QA Friends"). WebButton("Login"). GetROProperty("disabled")

‘To get whether a checkbox is on or off.

Val =Browser("QA Friends").Page("QA Friends").WebCheckBox("Test").GetROProperty("Value")


Q. How can I modify the properties values of test objects in Object Repository during runtime?
A. You can use SetTOProperty method of test object.Object(description).SetTOProperty Property, Value - The values of test object properties are used to identify the objects. Sometimes the properties of the object in the application change dynamically. For example text of a link in a webpage is the username used to login to that page.Text property is used by test object to identify the link. So in order to identify the actual object we can manipulate the value of “text” property of link using SetTOProperty.

 

Q. How do you synchronize your scripts in QTP?
A. For waiting until navigation of web page completes we can use Sync method. For waiting until an object appears we can use Exist method. For waiting until a property of object changes we can use WaitProperty method. You can set browser navigation timeout in: Click Test > Settings menu Select web tab in Test Settings window. Enter the timeout in Browser Navigation Timeout text box. You can set global object synchronization timeout in: Click Test > Settings menu Select Run tab in Test Settings window. Enter the timeout in Object Synchronization Timeout text box.

 

Download the complete Document from here.

This is a .pdf file. Open this file in Adobe Acrobat Reader.

 

Related Posts:

QTP Interview Questions in IBM

QTP Interview Questions for Beginners - Part 1

QTP Interview Questions Set 1

QTP Interview Questions Set 2

QTP Interview Questions Set 3

QTP Interview Questions Set 4

QTP Interview Questions Set 5

QTP Interview Questions Set 6

QTP Interview Questions Set 7

QTP Interview Questions Set 8

QTP Interview Questions Set 9

QTP Interview Questions Set 10

QTP Interview Questions Set 11

QTP Interview Questions Set 12

Using Action Parameters in QTP

Action parameters enable you to transfer input values from your test to a top-level action, from a parent action to a nested action, or from an action to a sibling action that occurs later in the QuickTest Profession test. Action parameters also enable you to transfer output values from a step in an action to its parent action, or from a top-level action back to the script or application that ran (called) your test. For example, you can output a value from a step in a nested action and store it in an output action parameter, and then use that value as input in a later step in the calling parent action.

 

You can use action parameters in any step in your action (including function calls). You define the parameters that an action can receive and the output values that it can return in the Parameters tab of the Action Properties dialog box (Edit > Action > Action Properties or right-click an action and select Action Properties). You specify the actual values that are provided to these parameters and the locations in which the output values are stored using the Parameter Values tab in the Action Call Properties dialog box (opened by right-clicking an action and choosing Action Call Properties).

 

You can specify input parameters for an action so it can receive input values from elsewhere in the test. Input values for an action parameter can be retrieved from the test (for a top-level action), from the parameters of the parent action that calls it (for a nested action), or from the output of a previous action call (for a sibling action). You can also specify output parameters for an action, so that it can output values for use later in the test, or pass values back to the application that ran (called) the QTP test script.

For example, suppose you want to take a value from the external application that runs (calls) your test and use it in an action within your test. In the test below, you would need to pass the input test parameter from the external application through Action2 and Action3 to the required step in Action4.

 

Using Action Parameters 

 

You would do this as follows:

  1. Define the input test parameter (File > Settings > Parameters node) with the value that you want to use later in the test.

  2. Define an input action parameter for Action2 (Edit > Action > Action Properties > Parameters tab) with the same value type as the input test parameter.

  3. Parameterize the input action parameter value (Edit > Action > Action Call Properties > Parameter Values tab) using the input test parameter value you specified above.

  4. Define an input action parameter for Action3 (Edit > Action > Action Properties > Parameters tab) with the same value type as the input test parameter.

  5. Parameterize the input action parameter value.
    • Select Edit > Action > Action Call Properties > Parameter Values tab and select the input action parameter value you specified for Action2.

    • Use the Parameter utility object to specify the action parameter as the Parameters argument for the RunAction statement in the Expert View.

  6. Define an input action parameter for Action4 (Edit > Action > Action Properties > Parameters tab) with the same value type as the input test parameter.

  7. Parameterize the input action parameter value.
    • Select Edit > Action > Action Call Properties > Parameter Values tab and select the input action parameter value you specified for Action3.

    • Use the Parameter utility object to specify the action parameter as the Parameters argument for the RunAction statement in the Expert View.

  8. Parameterize the value in the required step in Action4.
    • Click the parameterization icon  and specify the parameter in the Value Configuration Options dialog box using the input action parameter you specified for Action 4.

    • Use the Parameter utility object in the Expert View to specify the value to use for the step.
    An action's parameters are stored with the action and are the same for all calls to that action. If you modify an action parameter's name, type, or description, and then view the action properties for a call to that same action in a different part of the test, you will see that the action parameter has changed.

 

The actual value specified for an input action parameter and the location specified for action output parameter can be different for each call to the action. When you insert a call to a copy of an action, the copy of the action is inserted with the action parameters and action call parameter values that were defined for the action you copied. When you split an action, the action parameters are copied to both actions. The action call values for the second action are taken from the default values of that action's parameters.

 

For information on defining action parameters and the values used in action calls, see Setting Action Parameters. For more information on working with action parameters, see Guidelines for Working with Action Parameters.

 

Go Back to: QTP Tutorial 8 - Working with Advanced Action Features in QTP