QTP10.com is a new and completely free website that offers help in all the versions of HP QTP (including latest version 10). More importantly, it offers free code for users of HP QuickTest Professioal. This site helps you in learning the basics of QTP and descriptive/advanced programming in (QTP) on various environments like - .Net, Infragistics, Web, Windows, etc.

Note -
This blog is NOT affiliated with HP / Hewlett-Packard in any way. The data/questions come from various sources and we have our own testing questions. I am just another Software Tester like you.

Sunday, August 30, 2009

QTP Vs Selenium

1. Actual end user simulation, Is the test conducted
using this tool equivalent to an end user action?


Selenium performs actions in the background on the
browser. It modifies the DOM structure of the HTML page in order to perform actions on the page. To be more precise it executes javascript on UI objects within the webpage to perform actions like click, type, select etc. This is the reason why you can execute tests with the browser minimized.

QTP claims to perform end user simulation, in other words executing QTP scripts is equivalent to a person performing those steps manually on the application.


2. Support for most UI Components

Selenium Certain events, methods and Object properties are not supported by selenium. But broadly most UI components are supported.

QTP requires extra add-ons (plug-in, not free) to work with .Net components.

3. UI-Object management & storage
QTP comes built-in with object repository. Object
repository management is quite easy in QTP. Selenium has no such built in feature but objects can be managed using UI-Element user extension. Other custom solutions like properties files can also be used in selenium. But for all such solutions the map file in selenium has to be hand-coded i.e unlike QTP the objects won't be recorded/added automatically .


4. Support for Dialog Boxes
QTP supports all kinds of IE dialog boxes. There is partial support for dialog boxes in Selenium. Some actions like retrieving the title of he dialog box can't be performed in selenium.

5. Support for web browsers
QTP supports IE & Firefox. Selenium supports
IE, Firefox, Safari and Opera and a few more browsers. But either tools are far far away from full cross-browser support. Don't expect scripts created using browser to run flawlessly in another browser.


6. Object Recognition Parameters, Recognition on the basis of WYSWYG (what you see is what you get).

Selenium recognizes objects on the basis of the DOM structure of the HTML Page. The UI objects in selenium have vague descriptions and don't comply with WYSWYG policy.

QTP recognises and names objects based on properties which are more visible and obvious and are hence the objects have user friendly names.

7.  Object Oriented Language support &
Scalability (as in Integration with External tools utilities and libraries).

Selenium Supports JAVA, dot net and many other industry standard programming languages. QTP supports vb script only.

8. Integration with test management tool.
QTP integrates seamlessly with QC and TD. Test management and mapping the manual testing process with automation becomes a lot easier with this integration. I have not yet heard of any test management tool that can integrate seamlessly with Selenium. keep an eye out for Bromide though.

9. Types of application supported
QTP wins this one hands down. This is one of the main reason why selenium can't even be considered in many cases. Imagine real-time applications like trading terminals, risk management applications built in TCL/TK and PowerBuilder. QTP supports most of these interfaces.

Selenium on the other hand can work only on applications that open up inside a browser. But aren't most applications moving to the browser based platform? :)

10. Support for operating system/platforms
Selenium Supports JAVA and hence can be used in Windows PC or MAC or UNIX. Using selenium you can test your web application in all the above platforms. QTP supports Windows only.

11. Ease of creation of Scripts
Selenium IDE Recorder is not as powerful as QTP but is good for a free tool, many actions are not recorded by the IDE and have to be manually entered.

12. Technical Support
QTP offers technical support by phone and mail, HP also have a web-forum.
QTP user community is vast and questions posted on online forums get answered quickly. Selenium being an open source tool has no official tech support, the user community is small, less-active and questions on forums seldom get answered. But the community is growing day by day as the tool gains acceptance.


13. Cost
QTP - Very Costly, in some thousand dollars per seat license.

Many people want to switch to selenium because it's free. But cost isn't really a factor when your client's a investment bank :)

14. Test Development Environment
When you are working on selenium you have the option of using wide range of IDEs like Eclipse, Netbeans, Visual Studio etc depending on your choice of development language. If you are a developer then you must have developed a taste for rich IDEs and switching to a environment given by a test tool may be hard for you.

QTP tests can only be developed in QTP.

15. Integration with development process
Tests developed using selenium can be easily part of the development project. Using tools like cruise control Continuous Integration is easier with Selenium. But don't get too caught up with this feature, it's really not that important to be integrated with the development process but it's nice to have.

16. Future in terms of usability and acceptance

The future bodes well for selenium because it's free, supports all programming languages/platforms and is immensely scalable and expandable due to it being free and open source. Many pundits have predicted that it will completely conquer the web testing market in the next 5 years. It being free makes a huge difference especially when times are hard like what we have now.

QTP on the other hand is the current market leader and I think that it will have it's presence for long due to it's user friendliness and support for interfaces other than web.

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

SPONSORED LINKS

Saturday, August 29, 2009

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

SPONSORED LINKS

Saturday, August 8, 2009

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

SPONSORED LINKS