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: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:
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 OptionsPlease refer the below screen shots to understand the features available under View Options Window:
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
Valid Syntax
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.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.
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 on the tool bar.
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.You can click the Custom Settings button to see the Custom Web Event Recording Configuration window.
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.As soon as you select Parameterize, you will see a Data Driver Wizard which will guide you through the complete parameterization process.
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.
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:
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.
Comments