Skip to main content

HP QTP Tutorial – Chapter 11

1 Tools

In my previous chapter, I discussed about the features available in Debug Menu such as Pause, Step Into, Watch Window, Run to Step etc. This chapter covers the features available under Tools Menu option. This chapter explains the following features available under Tools Menu:
clip_image002

The features under Tools menu are very useful and also frequently used. The various options available under tools menu change the QTP settings and easy how we work with QTP.

1.1 Options

The first feature available under Tools menu is Options which help in changing the QTP settings at global level. The changes made here are globally applied in all the Test Script and hence you must know the impact of those changes and also the best practices for making changes using Tools feature of QTP.
You can access Options by navigating to Tools->Options. The Options screen and various settings under Options are explained shown below:
clip_image004
Settings Description
General Display Add-In Manager on Startup Check this option when you want to see the Add-In Manager window while starting the QTP. This will ensure and also give you an option to check which all add-ins are available, enables or disabled. Based on your need you can enable or disable the add-ins at the launch of QTP. As a best practice, always keep this option as Checked
Display Start Page on startup You also noticed that when QTP load, you see a Start Page which displays some text. If you want to hide the start page you can uncheck this option. As a best practice you can uncheck this option so that loading time of QTP will be reduced.
Display warnings if associated add-ins are not loaded If you want to see a warning message to know if associated add-ins are loaded with test or not, you can enabled this option.
Keep this option checked
Disable recognition of virtual objects while recording QTP might treat unrecognized object as virtual objects while recording. To avoid it, you can uncheck this option.
As a best practice, let it be unchecked.
Automatically update test and component steps when you rename test object This is a very nice feature of QTP which eases your maintenance when you need to change the name of your test object in Object Repository. You do not need to worry about updating the Test Script with new test object name as QTP will automatically update the references in all the Test Script wherever Test object is being used.
Always keep this option checked.
Display keyword view for tests and scripted components In case you want to hide Keyword view, you can uncheck this option and you will only see Expert View and Not Keyword View.
Keep this option as checked as sometime a non-technical person will better understand the Keyword view rather than expert view.
Automatically parameterize steps using The best practice is to keep this option unchecked as you do not want to parameterize everything in your test script and want to work within your Framework.
Automatically generate “With” statement after recording To make code more readable you can keep this option checked but there is different approach so I will not recommend and leave it on the scripting guideline for your project. But I will recommend this as a best practice to keep this option checked.
Restore Layout If you want to restore the default layout or option you can reset the settings to default one by clicking on Restore Layout button
Generate Script You also want to ensure that all the Test Machines where scripting will happen should have same settings. To ensure that you can generate a script using “Generate Script” button and then save that script and ask each of your Test Engineer to run this script before they begin their scripting. You can also include this as mandatory steps in your Test Scripting Guideline.
General->Text Recognition clip_image006 Please do not make any changes here and let it be default. This is mostly used when you are using Text Checkpoint in your test. In real time scripting we hardly use checkpoint and hence we do not need to make any changes in this option.
Folders clip_image008 In this option you can define a folder path which will be used by QTP to find files. As a good practice, do not provide any folder location over here and leave it blank.
Active Screen clip_image010
clip_image012
To change the settings of the active screen you can use this tab. The good practice is to disable the Active screen capture to save QTP resources while saving the test. In real time, Active Screen are rarely used and good when you are learning QTP.
Please change your Active Screen settings from Custom Level window
Run clip_image014 The run setting under options allow to change the execution of the script.
Best practice is to select Run Mode as Fast and Uncheck “View Results when run session ends”
This will increase the speed of your test execution and hence increase efficiency.
Also ensure that “Allow other HP Products to run tests and components” – this should be checked if you are integrating QTP with ALM or other HP tools. If this checkbox is not checked then other HP tool such as ALM might not work with QTP.
Run->Screen Capture clip_image016 The setting under Screen Capture controls the Screen Shot and Replay of Test Steps (movie) while Test is running.
You can set the conditions when to Capture the Screen Shot and when to Capture the movie clip.
The best practice is to Capture the screen shot when error occurs during Run.
Windows Applications clip_image018 Using Windows Applications settings, one can control the behavior of QTP while working with Windows Based Applications.
The important part is listed in the Advanced section of the Tab where you have more ways to control the settings of Windows Applications
Window Applications->Advanced clip_image020 You can check or uncheck the options available in a tree like structure to capture the events on Windows Based Applications.
When you are working with Windows Based Application, do check the best practices which need to be followed as per your Automation Project or Organization. If no standard or guideline is available, it is advisable to create one and followed by all in the team.
Web clip_image022 The Web settings will allow you to control the capture of events when working with Web Based Applications. Since you are working most of the time with Web Based Applications, you must know the feature of Web Options.
As a best practice, please check Ignore ALM/QC so that the AUT should not conflict with ALM/QC when you are running your test.
Web- > Page/Frame Options clip_image024 The Page/Frame Options will allow how QTP will manage the Test Objects in your Object Repository.
You can define the conditions for 2 events:
- When to create a new Page Test Object
- When to create a new Frame Test Object
Best practice is not to make any changes in the default settings until your application need is very specific.
Web-> Advanced clip_image026 The Web Advance option give you control the Web settings while script creation and when running the script.
The best practice is to leave these settings as it is and do not make any changes until and unless the changes make sense for your Automation Requirement.

The Options feature under Tools menu is a very important feature which is normally used when you are preparing the Test harness before scripting. You do not revisit the Options feature again and again once you are done with the Final recommended settings as per your project requirement.
Another important point to note here is related to Third Party Addins such as SAP, PeopleSoft, Siebel etc. If you are working with these Add-Ins, then you might notice settings pertaining to these kind of applications. In that case you have to refer the user or technical manual of 3rd Party Add-Ins to learn more about the settings feature.

 1.2 View Options

The View Options provide the feature to control how the Script will look in the Expert View (QTP Script Editor Area). You can change text Color, font type, Switch on/off the line numbers etc. You can access View Options by navigating to Tools->View Options
Please refer the below screen shots to understand the features available under View Options Window:
clip_image028 clip_image030
clip_image032
You can define the Shortcut Keys using Key Binding tab of View Options. You can also use Key Binding Tab to learn about the current shortcut key commands.

 1.3 Check Syntax

This is a very commonly used command while doing the scripting. You must use “Check Syntax” command before executing your test script. You can either Press “Ctrl+F7” or navigate to Tools->Check Syntax to run a Syntax check on the QTP Script. If there are any errors the command will tell you about all the errors.
You can see all the error and success condition in the Information View Pane.

Syntax Error in Test Script

clip_image034

Valid Syntax

clip_image036

 1.4 Extensibility Accelerator

This is a feature introduced in QTP 11 as a solution to automated Web 2.0 application which involves AJAX, GWT, YahooUI etc. If you want to explore more about Extensibility Accelerator you can check the HP Technical Manual, Online resources. This is used by Advance user of QTP. This feature is also not extensively used. This tool comes as a separate installer and must be installed to use with QTP.

 1.5 Regular Expression Evaluator

This is a very handy tool available from QTP 11. You can develop and Test your regular expression before putting it into use. To access the Regular Expression, navigate to Tools->Regular Expression Evaluator.
clip_image038

 1.6 Object Identification

The object identification window allows you to make the changes in the definition of object so that QTP will make use of the changed definition to recognize the objects. You will see the object details of other environment such as Peoplesoft, Siebel, SAP etc if you have the necessary add-ins installed. To access Object Identification window, you can navigate to Tools->Object Identification. You will see a below window which will display the various windows or web objects and their Mandatory or Assistive Properties on the right side of the screen. As a best practice, please ensure that Smart Identification flag is un-checked for all the objects depending on the application. For e.g if you are working with Web Based, then you select all the object one after another and uncheck Enable Smart Identification property. Later on you can generate a script (Generate Script button) which you will run on all the machines where QTP is installed. This will ensure that QTP settings are same on all the machine for Object Identification.
Once you are done with above mentioned Object settings you can start building your Object Repository. You can also refer the project documentation or best practices for defining the object specific to your business need.
clip_image040

 1.7 Object Spy

The object spy is a very handy utility and very frequently used while doing scripting. This is a tool which gives you a view of the Test Object Property, Events etc for the selected object. By going through the object property you can build business rules for smart scripting. These properties will also help you in achieving or defining the expected result of the test cases.
You can access Object Spy feature by navigating to Tools->Object Spy or Click the image icon clip_image042 on the tool bar.
clip_image044

 1.8 Web Event Recording Configuration

The Web Event recording Configuration will give you the power of changing the behavior how QTP will record the events on the test object. In real time, you hardly need to change the settings in this window. But you should know the usage of this QTP feature in case if it is needed for your application. To access the feature, navigate to Tools->Custom Event Recording Configuration.
clip_image046
You can click the Custom Settings button to see the Custom Web Event Recording Configuration window.
clip_image048
You can define New Tag Objects in HTML Tag Objects and then add Listen Handler and Record mode as Enabled or Disabled.

 1.9 Data Driver

The Data Driver utility is handy when you are scripting with constant values and then want to parameterize all the constant at one go. You can use Data Driver feature which will scan your test script for constant value which are being used and help you in parameterizing the constant values. You can access Data Driver feature by navigating to Tools->Data Driver. If you see constant value in the Data Driver window, then it means your script is using Constant Value else your script is not using any hardcoded or constant values. This is also a good tool to check whether your script contain hard coded values or not.
clip_image050
As soon as you select Parameterize, you will see a Data Driver Wizard which will guide you through the complete parameterization process.
clip_image052

 1.10 Change Active Screen

The Change Active Screen is a feature which will help you in updating the Active Screen associated with a QTP test. If you are using Active Screen with your test and want to ensure that Active Screen is up to date as per application changes, then you can use Change Active Screen feature to update the old screen with the updated or latest screen of the application functionality.

As a best practice it is not recommended to save the active screen with your test as it increases the size of Test Script and need more storage space.
To access Change Active Screen, you navigate to Tools->Change Active Screen. The mouse icon will change into Hand and QTP will ask you to highlight the screen in your application and once you highlight the screen, your old Active Screen will be replaced with latest screen.

This feature is hardly used in real time test scripting.

 1.11 Virtual Objects

Let me first explain what is a Virtual Object? Any object which is not a standard windows object or web object but is a third party object being used in the application under test. To automate such third party object you map these 3rd Party Object with Standard Windows or Web Object. For e.g. if I have a window application where I am using a Third Party Grid View, then QTP will not be able to identify this object and I cannot proceed with the Automation. In such a case a solution is to map the Grid View Object with Standard Window Grid Object so that QTP will recognize the events performed on the Grid Object and automation can be achieved.
The recommendation is not to use Virtual Object mapping as a workaround or permanent solution to automated unrecognized object as this is not a fool proof solution. This is hardly used in real time scenario.
To access Virtual Object, you navigate to Tools->Virtual Object->New Objects or Virtual Object Manager depending on your need. If you already added Virtual Object and want to modify any of the properties, then use Virtual Object Manager. If you want to define a new virtual object, then use New Object option. You can also define New Object from Virtual Object Manager window. See the below screen shots.
clip_image054 clip_image056
The Virtual Object Wizard will guide you through the whole process of defining and mapping a virtual object to standard windows or web object.

 1.12 Customize

To add additional and more frequently used commands on the tool bar you can use Customize Window. To access the Customize Window, you navigate to Tools->Customize.
You just need to drag and drop the required commands on the QTP tool bar. Using the Toolbars tab you can customize the availability of various handy command such as Automation, Debug etc. Please refer the below screen shots:
clip_image058 clip_image060
We normally change anything here in real time. Most of the people go with default QTP settings until you are used to some other way of usage.

 2 References

Quick Test Professional Tool.

 3 Additional information

You can email me on Sachin.vasudha@gmail.com with any query.

4 What Next?

In my next Chapter I will explain the features of Object Repository Manager and Map Repository Parameters.

Comments

Popular posts from this blog

Revolutionize software testing with AI! 🤖💻 Share your thoughts on ethical implications in the comments.

  As technology evolves, so too does the field of software testing. One exciting development in recent years is the use of AI (Artificial Intelligence) to automate repetitive tasks and improve testing accuracy. Through analyzing large amounts of data and identifying patterns, AI can help identify potential defects or vulnerabilities in software. AI-powered tools can also generate test cases and scenarios by simulating user behavior and input, allowing for more efficient and effective testing. In addition, machine learning algorithms can analyze and learn from past testing data, leading to better predictions and more streamlined testing. AI-powered tools can also help identify and prioritize critical bugs and defects, saving valuable time and effort in manual testing. But it's important to note that AI-powered testing is not a replacement for human testers. While AI can automate certain tasks and help identify potential issues, it's still necessary for human testers to provide a

Is AI taking over your job in software development and testing? 😱"

Are you a software developer or tester feeling threatened by the rise of AI in your industry? 😰 You're not alone. Many professionals in the field are concerned about the potential consequences of AI's integration into software development and testing. While some experts believe that AI can bring significant benefits to the industry, others worry that it could replace human expertise altogether. 🤔 AI algorithms can analyze massive amounts of data and automate many tasks, but they cannot replace the critical thinking and creativity of human beings. Additionally, there are ethical concerns associated with the use of AI in software development and testing. So, what can you do to ensure that you're not replaced by AI in your job? 💪 First, it's essential to recognize that AI is not a replacement for human expertise but rather a tool to augment it. Therefore, it's essential to learn how to work with AI-powered systems to increase your efficiency and productivity. Additi

HP Quality Center - Best Practices

1.Introduction Quality Center is a test management tool which provides very good features for managing both your manual and automated test cases. This paper highlights the best practices for managing your test cases. When you open Quality center, depending on your rights it display the below mentioned option in the sidebar: 1. Requirements 2. Test Plan 3. Test Lab 4. Defects 5. Dashboard 2.Requirements When you have assigned with the responsibility of developing your test cases in the quality center then you must be wondering where to start with. I am going to share my experience to overcome such a situation. You need to find the solution of some question before you start writing your test cases. 1. Is your requirement developed and available? 2. Is your requirement organized in a logical sequence? If answer to both of the above question is Yes, then you can start with Requirement option in the side bar. In case your requirement is under development, then you keep your