HP Quick Test Professional Tutorial Chapter 2
1 FILE Menu
In the first series of this article you have seen the usage of various commands available in File Menu option. This paper is in continuation of my previous series and in this series we will mainly the File->Settings option. I have not included Setting explanation in the first series because understanding Setting is very important for real time usage. You will visit this option very frequently and you must understand its usage in a better way.
To open the Settings Dialog, Click File->Settings (as shown below).
We will see each useful option available in the above dialog which helps you a lot while you are developing your test script. I am going to explain about each option such as Properties, Run, Resources, Parameters, Environment, Web, Recovery, Local System Monitor (new in 10.0).
In the Properties, many of the static things are self explanatory. You can use Properties for:
· Adding or removing the associated add-ins for current test. If you are working on a web based application, it’s always a good practice to de-associate other add-ins to save on memory performance and avoid conflict while opening the Test. Associating or de-associating will require QTP to be started and then you can see your changes.
· You can use Properties Window to Generate the Script of your settings and save as .VBS file. The advantage of having this script is that it can be distributed to all the team members so that settings for all the Test Script remain same. A sample script is shown below:
When above script will run on the Team Members QTP installed machine, this will ensure same configuration of QTP for developing or running the script. This is a real life example of Generate Script usage which I have shown above. There may be other settings as well depending on organization or project needs.
Run option can be used for:
- Control your iteration if you are driving your test through excel – Use Data Table Iterations section to control your test execution:
- Run one iteration only will run the script only one time. This normally picks the data from Global Sheet.
- Run on all rows- Your test run as many times as there are number of rows in the Global Sheet. In real time I hardly use this as this will be an overhead and make your maintenance really costly.
- Run from row – here you can customize your test run by providing the From Row number andTo Row number. If you want to run from say row 2 to row 20, then provide your value as 2 and 20. I hardly use this option.
- Set the action that will be taken when script is running and encounter any error. The QTP will respond to that error in the defined way. So, if you want to suppress all the error, then you can choose “proceed to next step”. This way your script will not stop executing. But there are other impacts as well if you set this as an option. So, depending on your requirement you choose this option with care. This is a global setting option. As a best practice “pop up message box” is the best action for any script error or object error.
- Object Synchronization Timeout – This is very self explanatory. What time QTP waits for any object before it display you any error. You can define the timeout based on your requirement. Again this is a global setting.
- Disable Smart Identification during the run session – I am not diving in much depth (may be in next set of series I will deep dive) what Smart Identification means but as a best practice tick “Disable Smart Identification during the run session”. This will make your script robust when it runs.
- Save image of desktop when error occurs (if test is run by the HP Business Process Monitor) – New Option available in QTP 10.0 – I have not used this option. You can check the QTP help to know more about this option. But as per my experience we hardly make use of this since usage of this again is an overhead on the resources that will be saved with the test.
This is one of the important options in Settings Window. This will be very frequently used as you need to associate the relevant library and architecture file using this window. Once associated you can make full use of those library files while developing your script. This is something like include statement which you normally write in your C++ programming.
I have never used the Datatable option available in this window since my architecture load the required data file on the fly and so I never use this option. But if you want to set the other location for your Data file, then you can select Other Location option to do that. This Excel will be used during your Script development and execution.
How you will associate the Library file in your Test – Click the sign and you will see a line item in the grid, navigate to the location and select the library files that you want to associate with your test.
In real time, you should always associate pre-defined library files with your test. This option will be very frequently used by scripter in real time.
The parameter tab will also get used when you want to call your test with parameters. This is same as function arguments. The usage of the Input and Output parameter depend totally on your application requirement and framework development around your application. I can give you an example where I have used the Input Parameter in one of my complex project. I want to develop a mechanism wherein the Execution Team should have the flexibility to control the execution of test iteration. For e.g. If s/he want to run the test say from Row 20 to Row 30, then they can easily do it. They just have to provide the row number in QC from where they are running the Test.
These parameter are for Test and Not for Action. Remember there is substantial difference between the Test Parameter and Action Parameter usage. Output Parameter is again on global level wherin you can store the output in Quality Center. The usage entirely depends on the complexity and requirement of my solution.
To define these parameter, cick the sign and enter the parameter name, datatype, default value if any and description. After you define these parameter, you can see the parameter in QC Test Run Tab wherein you can provide value to Input Parameter and check the value of the output parameter.
The real time usage of these parameter is very complex and if you do not have good command, I suggest then do not experiment on real project in QC and instead practice first on demo qc.
There are 2 types of Environment variable:
· Built In – see the available environment variable. These built in variable are very handy while doing scripting, so please go through each of these built in variables. You can use these variable by writing Environment. Value (“ActionName”). You can change the Value parameter to either user defined variable or built in variable. The statement will return you the value available in the variable. This is very handy while designing the architecture around automation.
· User Defined – Any variable that is defined by user. As a best practice, define only global type variable for environment. You can export the variable as an XML file and then re-load with your test for usage. If you are not familiar with XML, then you can use this Tab to create all the user defined variable at one go. After creating all the variable, export to XML and then start making use of it across your Team.
I am not going to cover how to create user defined variable in this paper and will cover in next set of series for intermediate or advance.
I have not used this option in my real time. But for your information, you can make use of Web Tab for doing settings regarding timeout and storing user name and password for the web pages which require authentication on each run.
From this window, you can associate the relevant recovery file which will be called in case of any error. Select your recovery file and associate and you are done. If you have generic recovery file and you want to make use of that generic file for all your test, then do the association like this.
1.1.8 Local System Monitor (New in 10.0)
I have not used this option much, but if you want to monitor the application or program which your test will run or is running, you can do so by this Tab. The Tab gives you an option to monitor the performance of the local system. You can monitor Memory Usage, GDI Objects, Handle Count, Thread Count, %Processor Time, %User Time etc.
This completes the File Menu usage series. In next series, we will see the usage of Edit Menu. Keep checking my blog.
Quick Test Professional Tool