Thursday, November 10, 2011

QTP 11,Windows 7,IE 8 and IE 9


Here is the collected(from http://www.learnqtp.com/forums and
http://www.sqaforums.com)  information about QTP 10.0, 11.0 with OS
Windows 7 and IE 8/9.

Tool: QTP 11.0
OS:  Windows 7
Browser: IE 9
General Issues: Objects are not recognised and IE gets hanged.
Solutions: Install patch QTPWEB_00078

Tool: QTP 11.0
OS:  Windows 7
Browser: IE 8

General Issues: Objects are not recognised for Web Application.
Solutions:
1. Right Click and run QTP as an Administrator and then try recording
or recognizing objects.
2. Open QTP, go to Record and Run Settings and navigate to the Web tab
and change the settings from a specific browser settings to 'Record on
any open browser' setting and then try recording or recognizing
objects.
Reason for not working:
a. QTP needs Admin level privileges to some of its files/registry
options to perform its functionality.
b. Windows 7 has bought in levels of security, your User ID on your
test PC might NOT have had all the admin level privileges.
c. To do one time setting by right clicking on QTP desktop shortcut
and select Properties. Navigate to Compatibility Tab and check the
option Run as Administrator.

Tool: QTP 10.0
OS:  Windows 7
Browser: IE 8
General Issues: Objects are not recognised.
Solutions:
1. Install following two patches
   a. For IE8.0 - qtpweb_00037.exe.
   You can download it from:
   http://support.openview.hp.com/selfsolve/document/KM743912
   Here is the description of the patch:
    ========================================================================
   HP QuickTest Professional 10.00 Patch QTPWEB_00037
   (c) Copyright 2009 Hewlett-Packard Development Company, L.P.
   ========================================================================
   QTPWEB_00037 - Support for Internet Explorer 8
   ========================================================================
   This patch provides official support for testing Web applications
in Internet Explorer 8.
   It includes support for working with Internet Explorer 8 on all
operating systems that QuickTest Professional supports.
   (For the complete list, see the QuickTest Professional 10.00 Readme.)

   b. For Windows 7.0 - qtp_00644.exe.
2. Try the below settings:
   a. IE: Select the “Enable 3rd party extensions” option under Tools
–> Advanced section in IE
   b. Open Control Panel, choose User Accounts and Family Safety >>
System and Security Settings>>Change User Account Control
settings>>Set the control to ‘Never notify’ and restart the computer.

Tool: QTP 9.5
OS:  Windows 7
Browser: IE 8

General Issues: IE 8 gets crash.
Solutions: Uncheck 'ActiveX add-in' when launching QTP 9.5 will work
file with IE 8.
Note: Official Support for IE8 is QTP 10.0 with Patch QTPWEB_00037.

Monday, November 7, 2011

ExecuteFile



Have you used ExecuteFile in your Action/Script to call Lib files?
There is another option in QTP to call functions and Sub Routines via Associate Resources Files tab. What is the difference between both of them. Here is my view.

Say there is a main script which calls sub scripts they cover 10 scenarios. For 6 scenarios the variables, constants, functions and sub routines are required from 'text1.vbs,text2.vbs,text3.vbs,text4.vbs and text5.vbs'  and for other 4 the variables, constants, functions and sub routines written in 'GeneralLib1.vbs,GeneralLib2.vbs,GeneralLib3.vbs,GeneralLib4.vbs and GeneralLib5.vbs' are required. If we use File--> Settings--> Resources to associate all 10 vbs files to main script, it will take time to read all 10 vbs and will have impact on performance of the main script. ExecuteFile statement is very useful in this case. By using conditions like if else statements we can call the required lib files at the required steps.
Here is the example:
If scnNumber=1 Then
   ExecuteFile "C:\Library\text1.vbs"
End if

If your location of lib files getting change offenly then use relative path as
If scnNumber=1 Then
   ExecuteFile "text1.vbs"
End if
But make sure that folder path is associated at Tools--> Options--> General --> Folders as C:\Library.
Disadvantages of ExecuteFile statement over Accosiate Lib file are break point is not going to work and execution marker will not move to the file and function which is getting executed. It will be difficult for debugging.
Here are the advantages and disadvantages of ExecuteFile statement and Associate Lib files

Advantages:
1. It can be called one or more Lib file/s in another lib files.
2. Lib files can be called at the point where it is exactly needed.
Disadvantages of ExecuteFile command
1. Will not display execution marker even after selecting Normal Mode in Tools->Options->Run
2. Will not support break Points.
3. Will not support F11 at middle of execution
4. To use F11 at middle of execution, need to click on Pause then it will support F11. But even this cursor will not display on the line number where it is getting executed for every clicks of F11.
5. It will not list associated function libraries in Resources-> Associated Function Libraries.
6. If there is a break point in a script and the statement where break point is applied is calling a function which is present in other lib files, then if user click on F11, it will move next statement but will not invoke the lib file and will not show the cursor.
7. When you run an ExecuteFile statement within an action, you can call the functions in the file only from the current action.
8. Function Generator will not list the Library Functions in Operation Drop down.

Advantages of Associate Lib files
1. Supports break points and F11 from there.
2. Easy to debug.
3. Execution Marker moves over each statement for every press of F11, we can see what the statement does.