Monday, June 10, 2013

Does QTP support Netscape?

 
Note: Support for Netscape allows only to replay scripts on this browser. To create scripts, record first on Microsoft Internet Explorer, modify/adjust with help of Object Spy and then replay as needed
 
  • QuickTest Professional 11.
    Starting this version, support for Netscape was not included
     
  • QuickTest Professional 10.
           Netscape Browser: 8.1.3, 9.  
  • QuickTest Professional 9.5.
    Notes: Starting with this version, Web support was modified to include improvements related to tab handling.
    Netscape Browser: 8.1.3, 9.0
  • QuickTest Professional 9.2
           Notes: Tabbed browsing is not supported by QuickTest Professional for any browser type
           Netscape Browser: 8.1.2
     
  • QuickTest Professional 9.1
          Netscape Browser: 8.0
     
  • QuickTest Professional 9.0
         Netscape Browser: 8.0

Cheers,
Sreekanth


QTP WEB Add-in Support for Mozilla FireFox browser


Hi,

QTP WEB Add-in Support for Mozilla FireFox browser
Mozilla FireFox
QTP 9.2
QTP 9.5
QTP 10
QTP 11
UFT 11.5
v1.5
S
S
--
--
--
v2.0
S
S
--
--
--
v3.0 Alpha 7
--
S
--
--
--
v3.0, v3.5
--
--

S
--
v3.6
--
--
S
v4, v5, v6, v7, v8
--
--
--
S
v9, v10, v11
--
--
--
 QTPWEB_00090 + QTPWEB_00092
S
v12 
--
--
--
QTPWEB_00090 + QTPWEB_00100
S
v13, v14
--
--
--
QTPWEB_00090 + QTPWEB_00105
S
v15, v16 
--
--
--
QTPWEB_00090 + QTPWEB_00112
S
v17, v18
--
--
--
QTPWEB_00090 + QTPWEB_00122
v19
--
--
--
--
UFT_00001 + UFT_00037

S = Built-in Supported
"--" = Not Supported
 

 Cheers,
 Sreekanth














 

Sunday, January 24, 2010

Scripting langauage info. currently used in QTP

Hi ,
Hope some of you might faced the below question among urself or from others while working with Quick Test Pro.

"How could we know which scripting language is been used currently in QTP ?"

Well, it sounds a bit easy to look at this question and I do hope some of us knew the answer already.

For the folks who doesn't know , Here we go !!!
Use the below Built-In functions :
ScriptEngine --> Returns a string representing the scripting language in use.
ScriptEngineMinorVersion --> Returns minor version # of scripting engine in use.
ScriptEngineMajorVersion--> Returns major version # of the scripting engine in use
ScriptEngineBuildVersion --> Returns build version # of the scripting engine in use.

Copy the below code & paste it into Expert view & execute and see !!!
Code:
Msgbox "Script Engine currently running is : "&ScriptEngine
Msgbox "its minor version is : "&ScriptEngineMinorVersion
Msgbox "its major version is : "&ScriptEngineMajorversion
Msgbox "its Build Version is : "&ScriptEngineBuildVersion


Sunday, January 17, 2010

QTP 10 Version - Patches

Hi ,
In view of the given below, HP introduced the corresponding Patches for Quick Test Pro 10 V.
- Support Stingray Studio 10.0/1 MFC8/9
- Recognize SilverLight 2.0 App with SilverLight 3.0 Plug-in
- Improve Performance on Siebel Apps
- Stability Fixes for QTP Debug Viewer
- Do Not Filter Invisible Windows
- Fix Exist When Used With ChildObjects
- Improve QTP Folder Browsing Speed
- Fix Corrupted File Causing QTP Crash
- Support for Internet Explorer 8
- New QuickTest Silverlight Add-in
- Silverlight Support for QC Add-in
- Fix Debug Viewer Problems with PDM
- Prevent Unexpected Icons in Big Tests
- Fix Rec Scenario Function Library Display in QC
- Add Recovery Scenario Function Library Dependency
- Add Support for PowerBuilder 11.5
- Support VisualAge Smalltalk 7.5
- Support Stingray Studio 10.0/1
- Allow RegEx's in WPF Properties

- Support Windows 7 and Server 2008 R2 (Patch :QTP_00644)

Refer HP site for more info on the patches.

Saturday, January 16, 2010

Script to Upload Attachment To QC

Hi All,
Here I am providing the way of uploading an attachment into Quality Center programmatically using "QC OTA" API.

Note: QuickTest should be connected to a Quality Center server before executing below code.
Dim ObjCurrentTest,ObjAttch
Set ObjCurrentTest = QCUtil.CurrentTest.Attachments
Set ObjAttch = ObjCurrentTest.AddItem(Null)
ObjAttch.FileName = "C:\...\SampleTestResults.xls"
ObjAttch.Type = 1
ObjAttch.Post
ObjAttch.Refresh

After the above execution, 'xls' file would be attached to current Testscript 'Attachments' Section in QC.

Thursday, January 14, 2010

QTP Version History

Hi All,
Belated Happy New Year to you all :):)

Here I would like to share the version history of Quick Test Pro .
1998 -> Astra QT
2000 -> QTP 5.0
2001 -> QTP 5.5
2002 -> QTP 6.0
2003 -> QTP 6.5
2004 -> QTP 8.0
2005 -> QTP 8.2
2006 Feb -> QTP 9.0
2007 Jan -> QTP 9.1
2007 Feb -> QTP 9.2
2008 Jan -> QTP 9.5
2009 Feb -> QTP 10

Sunday, December 27, 2009

Retrieve Field/column count of Database Table

Hi ,
Here is the script for finding the number of fields/columns of a Table in MS Access Database.
Code:
Dim db
Set db=createobject("ADODB.Connection")x.ConnectionString="DBQ=C:\PROGRAM FILES\HP\QuickTest Professional\samples\flight\app\flight32.mdb;DefaultDir=C:\PROGRAM FILES\HP\QuickTest Professional\samples\flight\app;Driver={Microsoft Access Driver (*.mdb)};DriverId=281;FIL=MS Access;FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\flight32.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
db.open
Set RecordSet=db.Execute("Select * from orders")
Set r= RecordSet.fields
msgbox r.count ' Number of the columns in the table 'ORDERS'
For i=0 to r.count-1
msgbox r(i).name ' name of the field/column
Next
db.close
Set db=nothing

Import Data from Database Table to Datatable

Hi ,
Here is the script for importing the data from a specific column of MS Access Database Table to Datatable's GlobalSheet.

Code :
Dim db
Set db=CreateObject("ADODB.Connection")
db.connectionString="DBQ=C:\PROGRAM FILES\HP\QuickTest Professional\samples\flight\app\flight32.mdb;DefaultDir=C:\PROGRAM FILES\HP\QuickTest Professional\samples\flight\app;Driver={Microsoft Access Driver (*.mdb)};DriverId=281;FIL=MS Access;FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\flight32.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;"
db.Open
Set RecordSet=db.Execute("Select * from Orders")
i=1
While (NOT recordset.EOF)
Datatable.SetCurrentRow(i)
Datatable("CustomerName",dtGlobalSheet)=Recordset.Fields("Customer_Name")
msgbox Datatable("CustomerName",dtGlobalSheet)
Recordset.MoveNext
i=i+1
Wend
db.Close
Set db=Nothing

Sunday, December 6, 2009

Encrypting a String in QTP

Hi All,

Here we go !!!!

QTP has an utility Object called as "Crypt" object.
As the name implies, the "Crypt" object in HP Quicktest Professional is for encrypting the strings which can only be understood by QTP's "SetSecure" method. "Encrypt" is the only method supported by the QTP "Crypt" object.

Way1:
syntax : Crypt.Encrypt(Your String)
An example:
str="ExpertQTP"
var=Crypt.Encrypt(str)
msgbox var

The output of the above code would be "4ac6e9ba26cad2886bf331a767bfa1ce055f68e66bed5d61"
As you can see, this string is encrypted which is quite obvious.
Note:
Recording on password protected fields automatically encrypts your string for example

Browser("micclass:=Browser").Page("micclass:=Page").WebEdit("name:=Password").SetSecure "4ac6e9ba26cad2886bf331a767bfa1ce055f68e66bed5d61"

Way2:
Another way , how we can encrypt a string is by using "Mercury.Encrypter"
Set var=CreateObject("Mercury.Encrypter")
Msgbox var.Encrypt("QTP")
Set var=Nothing 'Release the Object reference

Way3:
Using "Password Encoder".
Navigate to Start-> All Programs-> QuickTest Professional-> Tools-> Password Encoder
Provide your string inside the "Password" field and click on the Generate button. Your encrypted string would be displayed inside the "Encoded String" field.

Wednesday, October 21, 2009

Count number of lines in Text File

Hi ,
Here I am provding the code for finding the number of lines in a Text file.
Code :
Const ForReading = 1
Set fso = CreateObject( "Scripting.FileSystemObject" )
Set textFile = fso.OpenTextFile( "your file path "
, ForReading )
textFile.ReadAll
Print "Number of lines: " & textFile.Line

textFile.Close

Monday, October 12, 2009

QTP script to Add defect in QC

Hi ,
Most of us would be familiar with logging defects in Quality Center manually.
How about Adding a defect using a QTP script?
Here we go !!!
Script :
Set TDConnection = CreateObject(”TDApiOle.TDConnection”)
TDConnection.InitConnection “http://yovav/tdbin” ‘ DB URL

TDConnection.ConnectProject “TD76″,”bella”,”pino” ‘ Valid login information
If TDConnection.Connected Then

MsgBox(”Connected to ” + chr (13) + “Server ” + TDConnection.ServerName _+ chr (13) +”Project ” + TDConnection.ProjectName )
Else
MsgBox(”Not Connected”)
End If

‘Get the IBugFactory
Set BugFactory = TDConnection.BugFactory
‘Add a new empty bug

Set Bug = BugFactory.AddItem (Nothing)
‘fill the bug with relevant parametersBug.Status = “New”

Bug.Summary = “Connecting to TD”
Bug.Priority = “4-Very High” ‘ depends on the DB
Bug.AssignedTo = “admin” ‘ user that must exist in the DB’s users list
Bug.DetectedBy = “admin” ‘ user that must exist in the DB’s users list
‘Post the bug to DB ( commit )

Bug.Post

Tuesday, October 6, 2009

Vital points to remember about Virtual Objects

Hi All,

Below are the important points which need to be noticed by us prior to using Virtual Objects in QTP.

Important Points :
1. A group of Virtual Objects are stored in Virtual Object Manager under a descriptive name known as “Virtual Object Collection”.

2. Analog & Low-level recording on Virtual Objects is not supported by QTP.

3. Recognition of Virtual Objects can be disabled without deleting them from Virtual Object Manager.

4. Virtual Objects can only be used when recording & Running the tests. Any type of checkpoint on a virtual object cannot be inserted.

5. The Virtual Object Collections shown in the Virtual Object Manager are stored in our computer (where they are created) and not in the tests that include the virtual object steps. This means that if you the virtual object in a script, the object will be recognized during the run session only if it is run on the computer containing the appropriate Virtual Object Definition. To Copy your virtual object definitions to another computer, copy the contents of your \Dat\VoTemplate folder (or individual collection files within this folder) to the same location on the destination computer.

6. Virtual Objects can only be defined for objects on which you can click or Dbl click and that record a click or Dbl click operation. Otherwise, the virtual object is ignored. For example, if you define a virtual Object manager over the WinList object, the “Select” operation is recorded, and the virtual Object operation is ignored.

7. You cannot use the Object Spy to view the properties of Virtual Object.

Few Enhancements need to be incorporated in QTP

Hi ,
Many times people tend to ask what Limitations does QTP has.
Now it is very difficult for one to list out clear limitations of a tool but it is far more easier for one to point the enhancements required.
With now over 5 years of experience from QTP 8 to QTP 10, thought of highlighting all the enhancements that we could think of.

Lets hope HP would look at few of these seriously and incorporate them in upcoming version of QTP. :):):)

In case you can think of other enhancements that can be included in the below then do let us know .

Object Spy Enhancements :
1. Object spy to have an option to export all the objects in hierarchy with their properties and methods to a XLS/XML file. And also to have an option to reload this offline. This feature would help for others to analyze a object recognition remotely
2. Object spy to have the ability to run without QTP. Currently object spy can only be loaded through QTP
3. Object spy to have an option to disable the Auto spy. Currently hovering on any object displays it properties without the need to click the object. This at time gives poor performance while spying objects
4. Currently Object Spy button gets disabled when the script is run, one has to launch object repository and then launch Object Spy from there. The Object Spy should enable directly when the script is run
5. Object Spy Automation capability, so other tools can leverage the same and automate the OR creation based on custom rules
IDE Enhancement
6. Ability to open multiple scripts at one time
7. Project explorer with capability to create folder and organize library files in them
8. Improved Intellisense for objects created through DotNetFactory
9. Intellisense for VBScript classes
10. Function folding in the IDE
11. Transition from Design mode to Run mode causes too many flickers in the IDE UI. This needs to be smooth
12. Ability to view code for Test flow in Expert view. This is currently only possible through Keyword view
13. Design time non-syntax error check for issues like Duplicate variable declaration etc
14. Intellisense of current associated libraries in all Libraries. Currently if Lib1 and Lib2 are associated with a Test. The Lib1 will only show Intellisense for Lib1 and not for Lib2. The Test will show Intellisense for both Lib1 and Lib2. This creates difficulty when Lib2 functions need to be called in Lib1

Object Repository Enhancements :
15. Ability to create and load OR’s from QTP script itself
16. Ability to load Shared ORs dynamically to all the Actions. Currently RepositoriesCollection.Add methods adds the SOR to the current Action only and not other actions
17. Changes made through SetTOProperty in one Action does not get propagated to Next Action
18. Ability to enumerate all child objects present in the OR for a specified object
19. Ability to specify nickname for Objects. This would help get a complete object hierarchy through just the nick name
Object Repository Manager Enhancements
20. Ability to load and save directly to OR in XML format
21. Ability for multiple users to access the Shared OR at the same time for updating
22. Export/Import of Checkpoints from one SOR to another
23. Merging of SOR’s to an existing SOR. Currently when two SOR are merged, the merged SOR needs to be saved as a different file
24. Ability to update code when conflict resolution renames object during SOR merge. In case object A and B are merged and name A is chosen over B, all scripts using name B needs to be updated manually
Scripting Enhancements
25. More options for other scripting languages i.e. JScript, VB.NET, C#.NET etc…
26. Support for start and finish events in Action and Test. E.g. – Test_Init, Test_Terminate, Action_Init, Action_Terminate. Currently this can be achieved through use of class but it would be easier for people to use if the functionality is built-in
27. Ability to execute specified VBScript even before the test execution starts. This script would run outside QTP and would help make changes to QTP settings that cannot be done during run-time. This would help in overcoming limitations like Libraries cannot be associated at run-time
28. Ability to execute specified VBScript even after the test execution starts. This script would run outside QTP and would help perform post execution code. This would be helpful in scenarios like sending email with the report
29. Ability to create error handler functions which are automatically called when an error occurs
30. Performance improvement when using Descriptive programming when compared to Object Repository usage
31. Ability to Debug libraries loaded during run-time using Execute, ExecuteGlobal and ExecuteFile
32. Ability to register generic functions for any object type. Currently RegisterUserFunc can only be used to register the method for a single object type. So if a new Set method is created then multiple RegisterUserFunc statements need to be written. QTP should provided some way to use a pattern or something to apply the same method to multiple object types
33. Ability to Unlock a locked system from within the code34. Ability to prevent screen locking during the execution
35. Ability to debug error which occurs during terminations of script. Currently any errors that occur during the termination of the script cannot be debugged and launches.

Recovery Scenarios Enhancements:
36. Recovery scenarios (RS) to run in a separate thread. Currently recovery scenarios run in the same thread as QTP. This causes recovery scenarios to be useless in case a Modal dialog blocks QTP
37. Option to stop chaining in recovery scenarios. Currently if RS1 and RS2 both match the trigger criteria then both of the scenarios are executed. There is no way to specify that RS2 should not be executed if RS1 is executed
38. Currently there is no way to enumerate recovery scenarios present in a File
39. Recovery scenarios don’t work when they are associated at run-time
Test Reporting Enhancements:
40. Ability to create reports in different format. Excel, Word, HTML etc…
41. Reporting of errors or failure in different categories and priority. E.g. – Reporting a error with severity, priority and category (Application, Script, Validation, Checkpoint)
42. Exact location of the error in the script. This should include the line of code, error number, error statement
43. Direct ability to send report to a specified list of email addresses when the test end
44. Currently the reports can only be viewed through QTP reporter viewer and cannot be viewed on machines without this tool. Report should be made completely Web compatible so that I can be viewed in any browser in the same way it is displayed in report viewer
45. Ability to view status of current Action. Currently Reporter.RunStatus only provides the status of whole test and not for current action
46. Ability to enumerate the current status from within a Test i.e. Actions executed with details, checkpoints executed with details, recovery scenarios executed with details
Checkpoint Enhancements:
47. Ability to alter properties of all checkpoints during run-time. E.g. Expected bitmap of a bitmap checkpoint, expected values of a Table/DB checkpoint etc
48. Ability to create checkpoints at run-time
49. Ability to load checkpoints from a external file at run-time
50. Ability to enumerate all checkpoints present in current script

Keyword-Driven Testing

Hi ,
Most of the times , we might have noticed the term "Keyword Driven Testing" in QTP.

So, let's know some thing more about the Keyword Driven Testing.

This requires the development of data tables and keywords, independent of the test automation tool used to execute them and the test script code that "drives" the application-under-test and the data. Keyword-driven tests look very similar to manual test cases. In a keyword-driven test, the functionality of the application-under-test is documented in a table as well as in step-by-step instructions for each test. In this method, the entire process is data-driven, including functionality.

Once creating the test tables, a driver script or a set of scripts is written that reads in each step executes the step based on the keyword contained the Action field, performs error checking, and logs any relevant information.


Merits of keyword driven testing
The merits of the Keyword Driven Testing are as follows,
-> The Detail Test Plan can be written in Spreadsheet format containing all input and verification data.
-> If "utility" scripts can be created by someone proficient in the automated tool’s Scripting language prior to the Detail Test Plan being written, then the tester can use the Automated Test Tool immediately via the "spreadsheet-input" method, without needing to learn the Scripting language.

->The tester need only learn the "Key Words" required, and the specific format to use within the Test Plan. This allows the tester to be productive with the test tool very quickly, and allows more extensive training in the test tool to be scheduled at a more convenient time.


Demerits of keyword driven testing
-> Development of "customized" (Application-Specific) Functions and Utilities requires proficiency in the tool’s Scripting language. (Note that this is also true for any method)
-> If application requires more than a few "customized" Utilities, this will require the tester to learn a number of "Key Words" and special formats. This can be time-consuming, and may have an initial impact on Test Plan Development. Once the testers get used to this, however, the time required to produce a test case is greatly improved.

Note: Keyword-Driven Testing is generally implemented in Keyword Driven Framework.

Hybrid Test Automation Framework

Hi,
Here we go about Hybrid Test Automation Framework.

Prior to knowing about the Hybrid Test Automation Framework , weshould know about the existing frameworks.
Generally we have,
  1. Data Driven Framework
  2. Test Script Modularity Framework
  3. Keyword Driven Framework
  4. Test Library Architecture Framework
  5. Hybrid Framework

Hybrid Framework is the most commonly implemented framework is a combination of of the above techniques, pulling from their strengths and trying to mitigate their weaknesses.

This Hybrid test automation framework is what most frameworks evolve into over time and multiple projects.

Hybrid Automation Frameworks generally can accommodate any of the below:

Keyword-Driven & Data Driven

Test Script Modularity & Data Driven

Keyword-Driven,Data Driven & Test Library Architecture so on so forth.

Thursday, September 17, 2009

Creating MS Word document using QTP

Hi ,
Let us create a very simple document in MS Word using the script.
Check the below script:
Dim obj_MSWord
Set obj_MSWord = CreateObject("Word.Application")obj_MSWord.Documents.Add
obj_MSWord.Selection.TypeText "This is a simple text"
obj_MSWord.ActiveDocument.SaveAs "D:\qtpkingblogspot.doc"
obj_MSWord.Quit
Set obj_MSWord=Nothing

Lock your PC automatically after the execution of QTP Scripts

Hi ,
The beauty of Automation Testing is that Scripts are run in an unattended mode.
Thus, what people usually do is, prepare the batch of scripts and leave for their homes. After the batch gets over, no matter even if it passes or even get failed, the PC is unlocked inviting others to view your secret project related data.
This remains a small issue in a simple project based company.
However it can become extremely devastating issue in case of a company having Finance or Banking related projects, having top most concern for the security of its data.
So one wonders as to what can be the way by which this situation can be tackled?

You can use the following QTP Script to lock your PC :
Set obj = CreateObject("WScript.Shell")
sCmnd = "%windir%\SYSTEM32\rundll32.exe user32.dll,LockWorkStation"
obj.Run sCmnd, 0, False
The above QTP script will lock your PC automatically.
Moreover, I will suggest you to create this script as a separate script and call this script lastly in your batch. This will solve the purpose :)

Monday, June 29, 2009

Create TABLE in MS ACCESS Database thru script

Hi All,
Here i am providing the way of creating the table in MS Access database.
Script:
Set oConn = CreateObject( "ADODB.Connection" )
oConn.Open "QT_Flight32"
oConn.Execute "CREATE TABLE EventTable(" & _ "EventKey COUNTER ," & _ "Category TEXT(50) ," & _ "ComputerName TEXT(50) ," & _ "EventCode INTEGER ," & _ "RecordNumber INTEGER ," & _ "SourceName TEXT(50) ," & _ "TimeWritten DATETIME ," & _ "UserName TEXT(50) ," & _ "EventType TEXT(50) ," & _ "Logfile TEXT(50) ," & _ "Message MEMO)"

oConn.Close




Output:


Monday, June 22, 2009

Run Modes in QTP

Hi All,

Run modes in view of performance/speed :

Normal (displays execution marker)—Runs your test with the execution arrow to the left of the Keyword View or Expert View, marking each step or statement as it is performed. If the test contains multiple actions, the tree in the Keyword View Item column expands to display the steps, and the Expert View displays the script, of the currently running action. you can add
Delay in each step execution. You can specify the time in milliseconds that QuickTest should wait before running each consecutive step (up to a maximum of 10000 ms.)

The Normal run mode option requires more system resources than the Fast option, described below. You must have Microsoft Script Debugger installed to enable this mode.

Fast—Runs your test without the execution arrow to the left of the Keyword View or Expert View and does not expand the item tree or display the script of each action as it runs. This option requires fewer system resources. When running a test set from Quality Center, tests are automatically run in Fast mode, even if Normal mode is selected

Run Modes in the view of Updating of Test objects/Maintenace of Test scripts :

Maintenance Run Mode: Helps to repair the test in runtime and also Pause on any failure and interactively fix the failed step.
Update Run Mode: Updates test object descriptions; checkpoint, output value properties; Active Screen images and values.

Sunday, May 24, 2009

Script for Highlighting the Objects

Hi All,

Hope most of you people might be knowing how to highlight an Object in Object Repository using "Highlight in Application" button.
Here i am providing a way of Highlighting the Objects of specific Class programmatically(thru script).

' script :
systemutil.Run "http://www.qtpking.blogspot.com/"
Dim obj Set obj=Description.Create
obj("micclass").value="Link"
Set x=browser("QTP for you ...").Page("QTP for you ...").ChildObjects(obj)
For i=0 to x.count-1
x(i).highlight
Next


'Note: Add 'Page' object into Obj.Repo. before execution
Just execute the above script & watch the output.....:)