Sie sind auf Seite 1von 165

QTP Challenges 4 Experts

Just another WordPress.com site


Four Different Ways to Associate Function Libraries to our
QTP Scripts
26 MAR 2013 Leave a comment
by vsprasad2k in QTP
Most of the times, when you are creating test scripts or are designing a new QTP Framework, you
would be trying to come up with reusable functions which you would have to store in the function
library. Now, in order to use this function library with multiple test cases, you need to associate this
function library with your scripts. This article explains the 4 methods that will help you in associating
the function libraries in QTP Test Cases.
Based on the type of framework you are using, you can use any of the following methods to associate
function libraries to your QTP Script -
1) By using File > Seings > Resources > Associate Function Library option in QTP.
2) By using Automation Object Model (AOM).
3) By using ExecuteFile method.
4) using LoadFunctionLibrary method.
Lets see in detail how each of these methods can be used to map function libraries to your test scripts.
1. Using File > Settings > Resources > Associate Function Library
option from the Menu bar
This is the most common method used to associate a function library to a test case. To use this method,
select File > Seings option from the Menu bar. This will display the Test Seings window. Click on
Resources from the left hand side pane. From the right hand side pane, click on the + buon and select
the function library that needs to be associated with the test case.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
1 of 165 8/12/2014 6:10 PM
Associate function Library to QTP
2. Using AOM (Automation Object Model)
QTP AOM is a mechanism using which you can control various QTP operations from outside QTP.
Using QTP Automation Object Model, you can write a code which would open a QTP test and associate
a function library to that test.
Example: Using the below code, you can open QTP, then open any test case and associate a required
function library to that test case. To do so, copy paste the below code in a notepad and save it with a .vbs
extension.
1
2
3
4
5
6
7
8
9
10
11
12
13
'Open QTP
Set objQTP = CreateObject("QuickTest.Application")
objQTP.Launch
objQTP.Visible = True
'Open a test and associate a function library to the test
objQTP.Open "C:AutomationSampleTest", False, False
Set objLib = objQTP.Test.Settings.Resources.Libraries
'If the library is not already associated with the test case, associate it..
If objLib.Find("C:SampleFunctionLibrary.vbs") = -1 Then ' If library is not
already added
objLib.Add "C:SampleFunctionLibrary.vbs", 1 ' Associate the library to the
test case
End
3. Using ExecuteFile Method
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
2 of 165 8/12/2014 6:10 PM
ExecuteFile statement executes all the VBScript statements in a specied le. After the le has been
executed, all the functions, subroutines and other elements from the le (function library) are available
to the action as global entities. Simply put, once the le is executed, its functions can be used by the
action. You can use the below mentioned logic to use ExecuteFile method to associate function libraries
to your script.
1
2
3
4
5
'Action begins
ExecuteFile "C:YourFunctionLibrary.vbs"
'Other logic for your action would come here
'.....
4. Using LoadFunctionLibrary Method
LoadFunctionLibrary, a new method introduced in QTP 11 allows you to load a function library when a
step runs. You can load multiple function libraries from a single line by using a comma delimiter.
1
2
3
4
5
6
7
8
'Some code from the action
'.....
LoadFunctionLibrary "C:YourFunctionLibrary_1.vbs" 'Associate a single function
library
LoadFunctionLibrary "C:FuncLib_1.vbs", "C:FuncLib_2.vbs" 'Associate more than 1
function libraries
'Other logic for your action would come here
'.....
This was all about the dierent ways using which you can associate function libraries to QTP Scripts.
What are your views on this article? Can you think of any other points which I have missed and can be
added here? Please let us know your views using the comments section. Happy Reading.. :)
Reference: hp://www.automationrepository.com/2011/09/associate-function-library-to-qtp-script/
(hp://www.automationrepository.com/2011/09/associate-function-library-to-qtp-script/)
Does QTP / Unified Functional Testing Support Flex?
14 FEB 2013 Leave a comment
by vsprasad2k in QTP
Supports will depend on the version of Adobe Flex versions used to develop an application:
Flex SDK QTP 11 and below UFT 11.5
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
3 of 165 8/12/2014 6:10 PM
lower than v4.5 Adobe QTP Flex Add-in No
v4.5 No HP UFT Flex Add-in
HP Unied Functional Testing (UFT) Flex Add-in
To use the HP Flex Add-in, the Flex application must be prepared/congured/setup accordingly with HP Flex
Add-in agent les. For more information see, Document ID KM00339739 How to Prepare Flex Applications
for Testing with HP Flex add-in? (hp://support.openview.hp.com/selfsolve/document/KM00339739)
Starting UFT 11.5, HP provides support for specic versions of Flex, with the HP Flex Add-in for GUI
testing. Any other versions (mostly older), are not supported by UFT. We suggest trying QTP with Adobe Flex
Add-in (see below).
There is no current plans of providing backwards compatibility with Adobe QTP Flex Add-in, so scripts
using such version cannot be ran nor upgraded to be used with the UFT Flex Add-in.
For more information about limitations, see Troubleshooting and Limitations Flex Add-in, within the
Chapter 13 Flex Add-in of the HP UFT Add-ins Guide (hp://support.openview.hp.com/selfsolve
/document/KM00225579)
Adobe QuickTest Professional (QTP) Flex Add-in
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
4 of 165 8/12/2014 6:10 PM
IMPORTANT: Hewle Packard does not support the Adobe Flex add-in, only HP Flex add-in (read
section above), therefore we strongly suggest contacting Adobe (hp://www.adobe.com
(hp://www.adobe.com/)) to see about availability, support details, and pricing.
If yor are currently using the Adobe QuickTest Professional Flex Add-in, support forAdobe (Macromedia) Flex
applications must be handled by Adobe.
Adobe has a Flex Builder; commonly this includes the QuickTest Professional Flex add-in. The add-in was
developed using QuickTest Professionals Test ExtensibilityArchitecture functionality. The Flex add-in is
developed and owned by Adobe.
Adobe is providing the add-in via an automation package that is shipped with Flex Builder 3 Professional. Basic
information on the automation package with QuickTest Professional integration is here:
hp://www.adobe.com/support/documentation/en/ex/3/releasenotes_ex3_.html (hp://www.adobe.com
/support/documentation/en/ex/3/releasenotes_ex3_.html)
hp://www.adobe.com/products/ex/upgrade/ (hp://www.adobe.com/products/ex/upgrade/)
Users can download the automation package with QuickTest Professional integration
here: hp://www.adobe.com/cfusion/tdrc/index.cfm?product=ex (hp://www.adobe.com/cfusion
/tdrc/index.cfm?product=ex)
A specic Adobe license is required and needs to be requested from Adobe. No specic Flex license is required on
the QuickTest Professional side.
Note: Support for the Flex add-in is being provided by Adobe. Customers/end-users need to contact the Adobe
support organization for help with problems or questions related to the Flex add-in.
From the Flex Builder 3 release notes (hp://www.adobe.com/support/documentation/en/ex
/3/releasenotes_ex3_.html) (for an updated version, contact Adobe):
Requirements for Using the QTP Plug-in
To test applications with Flex Automated Testing and the QTP agent, you must install the following:
HP QuickTest Professional 9.1 (no support for Smart Identication), available from HP
HP QuickTest Professional 9.2 and patch 1701 or later if you want Smart Identication support
Adobe Flex 3 Plug-in for HP QuickTest Professional
Microsoft Internet Explorer, version 6 or later
Flash Player ActiveX control, version 9.0.28.0 or higher
How to clean uninstall Unified Functional Testing (UFT)?
14 FEB 2013 Leave a comment
by vsprasad2k in QTP
As of right now, there is no specic specialized uninstallation process for UFT 11.5 or higher, so HP
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
5 of 165 8/12/2014 6:10 PM
recommends:
Review Requirements:
Important. Same as QuickTest Professional (QTP) or Service Test (ST), full admin rights and UAC o
is required before doing steps below. For more information seeDocument ID KM183747 What are
the minimum permissions required for QuickTest Professional (QTP)?
(hp://support.openview.hp.com/selfsolve/document/KM183747)
1.
Check the optional tasks
(Optional) Backup licensing information:
Seat license: back up the LSERVRC le. For more information seeDocument ID KM175077
What is the lservrc le and where to nd it? (hp://support.openview.hp.com/selfsolve
/document/KM175077)
Concurrent license: Save contents of LSHOST/LSFORCEHOST Windows environment
variable(s). For more information see Document ID KM175036 How to set the LSHOST or
LSFORCEHOST system variable? (hp://support.openview.hp.com/selfsolve/document
/KM175036)
1.
(Optional) Backup Test/Resources stored locally (if on ALM/QC, ignore step) 2.
2.
Uninstall any non-core add-in/utilities.
Remove any of the below items if exist on machine from the Programs and Features under
Windows Controls Panels (or Add/Remove Programs for operating systems older than Windows
Vista), before continuing:
Unied Functional Testing (UFT) Add-in for Application Lifecycle Management (ALM) / Quality
Center (QC)
.NET Extensibility Add-in
WPF/SilverLight Extensibility Add-in
Java Extensibility Add-in
Web Extensibility Add-in (if displayed)
Extensibility Accelerator Note: ensure to backup EA projects before uninstalling it
3.
Uninstall Unied Functional Testing from the Programs and Features under Windows Controls
Panels (or Add/Remove Programs for operating systems older than Windows Vista)
4.
Delete any traces left.
Review and check for traces mentioned on below documents, under the Delete any traces
left section:
Document ID KM171368 How to perform a clean uninstall of QuickTest Professional (QTP)?
(hp://support.openview.hp.com/selfsolve/document/KM171368)
Document ID KM1016043 How to perform a Clean Uninstall of Service Test (ST)?
(hp://support.openview.hp.com/selfsolve/document/KM1016043)
5.
Note: The uninstallation steps above, or related documents, do not indicate removing any of the
components used by tool (prerequisites or post-installation requirements). If end-user needs to remove
then, collect the versions information of those currently installed on client machine, this in case other
separate products unrelated to UFT is aected.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
6 of 165 8/12/2014 6:10 PM
Does QuickTest Professional (QTP) and/or Unified
Functional Testing (UFT) support Citrix?
14 FEB 2013 Leave a comment
by vsprasad2k in QTP
For more information about Citrix XenApp product, see external
reference:hp://en.wikipedia.org/wiki/Citrix_XenApp (hp://en.wikipedia.org
/wiki/Citrix_XenApp)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
7 of 165 8/12/2014 6:10 PM
Supported versions
Citrix MetaFrame
Presentation Server
QTP 9.2
QTP
9.5
QTP
10.0
QTP
11.0
UFT 11.5
GUI
Version 4.0 Yes Yes Yes Yes No
Version 4.5 No No Yes Yes Yes
Version 5 No No Yes Yes Yes
Version 6 (Xenapp) No No No Yes Yes
Notes:
XenApp is the new name for newer versions of Citrix (6 and higher). For
more information see Document ID KM870314 Dierence Citrix
Metaframe Presentation Server and XenApp?
(hp://support.openview.hp.com/selfsolve/document/KM870314)
Citrix XenDesktop isnt supported.
If QTP 11 isnt viewing run results on Citrix XenApp 6, check with HP
Support about testing Hot-Fix QTP_00857 (This is a private patch only
provided by HP Support, so if needed, please submit a case)
Scope of support (What Citrix implementation is supported)
(IMPORTANT) Requirements: To record and replay against application(s)
hosted on a Citrix environment, both QTP / UFT and application under
testing (AUT) must be:
Installed on the same machine (usually the server).
Running within the same Citrix session.
Example Scenario 1:
Application Under Testing (AUT) Location: Installed and hosted on Citrix
server
QTP / UFT Location: Installed on client
Status: Not Supported.
Notes: If try to record and replay against the application, QTP / UFT will
not recognize individual objects. In fact, QTP / UFT will view the entire
session Window as one object.
(hp://qtpchallenge.les.wordpress.com/2013/02/citrx1.jpg)Example Scenario
2:
Application Under Testing (AUT) Location: Installed and hosted on Citrix
server Status: Supported.
QTP / UFT Location: Installed and hosted on Citrix server
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
8 of 165 8/12/2014 6:10 PM
Requirement:Both QTP and AUT must be under same Citrix Session (this
may required special conguration). See ilustration below to check
recommended scenario where support works appropiately
Notes: Citrix hosting a virtual version of a Windows operating system and
within such, both QTP / UFT and the AUT are installed; QTP / UFT will be
able to interact virtually with any item/element/program installed on such
operating system as if it were a physical operating system. This is
normally seeing as using the same session
(hp://qtpchallenge.les.wordpress.com/2013/02/citrx2.jpg)
Note:One suggestion to determine if the QTP / UFT recognition works ne on
same Citrix session
When using the Object Spy, the pointy hand cursor (when actually spying)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
9 of 165 8/12/2014 6:10 PM
remains the same (stays as pointy-hand-cursor, instead of the default
icon/cursor, such as the pointing-arrow). If it changes back while still actually
spying (while hovering mouse on top of desired application to spy), AUT and
QTP / UFT are not using the type of same session required.
License Requirements
It is required to use a concurrent (oating) license to operate QTP / UFT in a
Citrix environment.
For more information, please refer to:
Document ID: KM183794 Unable to launch QTP / UFT in a Terminal
Services/Citrix environment with a seat license
(hp://support.openview.hp.com/selfsolve/document/KM183794).
Document ID KM497568 Can the License Server be installed on a Virtual
Machine? (hp://support.openview.hp.com/selfsolve/document/KM497568)
More feedback
From the QTP / UFT documentation:
When running QuickTest on a remote machine using a Remote Desktop
Connection session (RDC) or using Citrix, if the remote session is minimized
during the run session, or if the computer on which the application is being tested
is logged o or locked, the following problems may occur:
the test or component run session may fail
steps that contain keyboard or focus operations may fail
the Test Results still image capture and/or the Mercury Screen Recorder may
display a black screen
steps for which the device level replay is congured to use the mouse (instead
of browser events) to run mouse operations may fail. (Set the device level
replay using a Seing.WebPackage(ReplayType) statement or by seing the
Replay type option in the Advanced Web Options dialog box.)
Workaround: If using Citrix or a Remote Desktop Connection session to run a
test or component, do not minimize the session window, and make sure that the
computer on which the application is being tested is not logged o or locked.
Critical patches available for Unified Functional
Testing (UFT)
14 FEB 2013 Leave a comment
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
10 of 165 8/12/2014 6:10 PM
by vsprasad2k in QTP
Feature -Patch
Core Product -UFT_00001 UFT Service Pack 11.51 (hp://support.openview.hp.com/selfsolve
/document/KM00337418)
HP UFT Add-in for ALM UFTALM_00001 UFT Add-in Service Pack 11.51 for ALM
(hp://support.openview.hp.com/selfsolve/document/KM00337421)
HP Results Viewer UFTRRV_00001 UFT RRV Service Pack (hp://support.openview.hp.com
/selfsolve/document/KM00337422)11.51
HP Extensibility Accelerator UFTEXA_00001 UFT EA Service Pack 11.51
(hp://support.openview.hp.com/selfsolve/document/KM00338055)
Note: The ALM Integration Enablement Pack (required for UFT to connect to ALM 11.5) is a pack to be
installed on ALM server, not on UFT client
What is the difference between QTP and UFT ?
12 FEB 2013 Leave a comment
by vsprasad2k in QTP
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
11 of 165 8/12/2014 6:10 PM
HP Unied Functional Testing [UFT] is a new tool released in December of
2012 that integrates two of HP Testing products in a common IDE. It
provides a powerfull testing framework for GUI and API testing:
HP Service Test
HP QuickTest Professional
HP Unied Functional Testing has enhanced, and brand new functionalities
that are not available in previous versions of HP Service Test or HP QuickTest
Professional.
Some important considerations
Many, not all, of the knowledge base articles available for HP QuickTest
Professional 10, 11 and HP Service Test 11.20 can be applied to HP Unied
Functional Testing product.
Licenses for QTP or ST will work for UFT, but they can restrict some
features. Its recomendable to upgrade to UFT Licenses to take advantage
to the complete functionality provided by the tool.
If you just need API Testing, you can use HP Service Test Standalone,
however this option its not avaialble for GUI testing.
HP Unied Functional Testing oers integration with Perfecto Mobile in
order to perform Mobile Testing.
HP Unied Functional Testing oers new Add-ins for GUI testing as such
as: QT and Flex.
HP Unied Functional Testing is not considered to be newer version of
either QuickTest Professional or ServiceTest.
09 FEB 2013 Leave a comment
Know more about HP UFT 11.5 [Click to download] (hp://h30499.www3.hp.com/hpeb/aachments
/hpeb/sws-583/198/1/Functional%20Test%20Webinar%20Nov%2028%20nal%20slides.pdf)
HP UFT 11.5 [Unied Functional Testing tool]
-Its an unique platform for testing almost all kind of applications.
- HP QTPs latest version, combination of QTP and Service Test
- Key Bents:
Automate testing of multi-layer test scenarios, including GUI and API testing.
Powerful visual user experience and toolset
Testing of emerging technologies with innovative HP UFT Insight object recognition
Easy conversation of manual tests to automated tests
Framework denition for beer test management thanks to tight integration to HP Business Process
Testing and HP Application Lifecycle Management
LINK by vsprasad2k
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
12 of 165 8/12/2014 6:10 PM
Reasons for Why BPT is a Great Testing Framework
09 JAN 2013 2 Comments
by vsprasad2k in QTP
1) You can build and run tests quickly and easily
BPT speeds up test creation, maintenance and execution through reuse of components.
2) You dont have to be an automation expert to use BPT
Manual testers, automation engineers, and subject maer experts can all use BPT eectively.
3) People in dierent testing roles can all work together
BPT helps you document your components and tests, including screenshots, how they should be used,
etc. This makes it easy for people with dierent roles and skillsets to share each others assets.
4) You can run the same test automatically and manually
Youre free to choose how to run your tests. And if you want to automate your existing manual tests,
you can continue to run them manually until youve completed the automation.
5) You dont need to build your own framework
Creating a framework is expensive and time consuming. You avoid all of that with BPT, which gives you
everything you need out of the box, and is fully customizable so that you can tailor it to the way you and
your organization work.
6) You can easily create and update tests for SAP, Oracle, and other so-called packaged applications
You can use pre-congured test assets such as those oered by TurnKey (hp://h20229.www2.hp.com
/partner/directory/ax/us/turnkeysolutions.html) to save time and eort in testing leading ERP and CRM
applications.
7) Testing can start early
Keywords and components can be dened before the application has been delivered for testing, so you
can design tests earlier in the software development lifecycle.
8) Youre encouraged to plan your testing activities in advance
BPT helps you think about what youre going to test, how youre going to test it, and the components
and other assets youll need.
9) BPT is fully integrated with HPs test management and testing tools
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
13 of 165 8/12/2014 6:10 PM
BPT is tightly integrated with lots of HP tools for example, Application Lifecycle Management
(hp://hp.com/go/alm), QuickTest (hp://hp.com/go/uft), Service Test (hp://hp.com/go/uft), Sprinter
(hp://h30499.www3.hp.com/t5/The-Future-of-Testing-Blog/HP-Sprinter-Improving-Quality-without-
Automated-Testing/ba-p/5739783#.UFnK5o2Ur0Q), etc., so you dont need to learn a whole new set of
tools.
QTP object identifications issues when working with
.Net Application
10 NOV 2012 Leave a comment
by vsprasad2k in challenges, QTP, Web Extensibility Add-in
Points to ponder when you face QTP Object Identication issues working with .Net Applications:
Check which object controls they have used in .Net Application development. Like:
Infragistics NetAdvance object controls:
TestAdvantage for Windows Forms 2007 contains QuickTest Professional Custom Libraries for the
Infragistics NetAdvantage for Windows Forms 2007 Volume 1 Controls. QuickTest Professional and
.NET Add-In
1.
HPs QuickTest Professional provides the industrys best solution for functional test and regression
test automation addressing every major software application and environment. QuickTest
Professional employs the concept of keyword-driven testing to radically simplify test creation and
maintenance.
2.
hp://www.infragistics.com/products/testadvantage-windows-forms-qhp/
(hp://www.infragistics.com/products/testadvantage-windows-forms-qhp/)
3.
DevExpress Object controls, QTP /DeveExpress Tech support doesnt have any extension/plug-in to
support the .Net Application developed using this object controls.
Verify whether you have installed the respective QTP Patches QTP_00699,
QTPNET_00082,QTPNET_00096, Etc.. [As required for swf/wpf objects]
After installation, launch QTP and select the rst radio buon in Windows tab on Record & Run
Seings window.
Key Enhancements in QTP 11.0
28 AUG 2012 Leave a comment
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
14 of 165 8/12/2014 6:10 PM
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized Tags: Features of QTP 11.0
Click here to see QTP Vs Selenium post (hp://qtp4experts.wordpress.com/qtp-vs-selenium/)
1) Support for new Operating Systems:
QTP 11.0 has added new support for the following operating systems:
Windows 7
Windows Vista SP2
Windows Server 2008 SP2
Windows Server 2008 R2
2) Enhanced Data Management Facility:
QTP is now seamlessly integrated with HP ALM (Application Lifecycle Management) software. Quality
Center (HP ALM) test conguration functionality enables us to determine at runtime which data sets to
use for our tests.
ALM test congurations enable us to:
Unbind our data from our tests
Share common data sources across dierent tests
Filter our data to t our testing needs
Increase requirements traceability
We store the data for our tests in the Quality Center Test Resources module in the form of data table
resource les.
We can then dene multiple test congurations for a test in the Test Plan module. When working with
data-driven QTP tests in HP ALM, each conguration is a QTP test that is set to run with a selected data
resource le and optional data lter seings.
One or more specic congurations of the test can be included in a Test Set to cover dierent parts of a
requirement or to cover multiple requirements.
By using Quality Center test congurations, we can create more generic tests and reuse them by
associating a dierent set of data with each. We can also reuse our data by associating the same data
table le with multiple tests.
3) New Object Spy Functionality:
The Object Spy has the following new features:
Add an object to a repository: We can now add an object to the object repository directly from the
Object Spy.
Highlight an object in our application: When we select a test object in the Object Spy Object hierarchy
tree, we can then select to highlight the object in our application that corresponds to that test object.
Copy/paste object properties: We can copy the identication properties and values of a selected test
object in the Object Spy and paste the details into any document. The details are formaed in
programmatic description syntax. This option is especially useful if we want to compare the
properties and values of two objects in our application or when creating programmatic descriptions.
Additionally, the Object Spy has a new, cleaner look and feel:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
15 of 165 8/12/2014 6:10 PM
4) New Smart Regular Expression list:
The Smart Regular Expression list provides syntax hints that make it easier than ever to insert regular
expressions into our test steps. It also enables us to access the Regular Expression Evaluator, which lets
us test regular expressions to make sure they suit our needs.
5) New QTP-Service Test integration facility:
Now we can test our GUI and UI-Less Application Functionality in One Test. We can use QTP steps to
start testing the GUI elements in our application, then call a Service Test test to validate service
communications (standard Web Services, non-SOAP Web Services, such as REST, etc.), and then step
back into our QTP GUI testing, all in a single test run.
The results of the QTP and Service Test steps are displayed in a unied report in the new Run Results
Viewer.
6) New Run Results Viewer:
The new Run Results Viewer provides an Executive Summary page with summary data, pie charts and
statistics for both the current and previous runs, a quick link to the previous run results, and more.
The Run Results Viewer displays the results of our run session in a set of panes that we can show, hide,
move, dock, and otherwise customize to our needs.
We can install the Run Results Viewer as a standalone installation. This enables us to share the results of
our tests with business analysts and developers who do not work with QTP.
7) New facility to hide the Keyword View:
If we prefer working only with the Expert View, we can now use an option in the Options dialog box to
hide the Keyword View so that only the Expert View is displayed when we open QTP Professional.
Facility to add Images to Our Run Results:
We can now add a Reporter.ReportEvent statement that includes an image le path. This lets us add an
image to the run results wherever one is needed.
9) New Log Tracking Functionality:
QTPs new Log Tracking functionality helps us work with developers to pinpoint the root causes of
unexpected behavior in our application.
When we enable log tracking, QTP receives the Java or .NET log framework messages from our
application and embeds them in the run results.
We can click a log message in the results to jump to the relevant step in the run results tree, or we can
click a step in the run results tree and view the log message that was generated at the time that the
selected step ran. We can also specify that a log message of a particular level (or higher) will fail our test.
After we view the results, we can print or export the log tracking details to a le to show to a developer,
or we can provide the developer with the standalone Run Results Viewer installation so that the
developer can view and analyze the results directly on his or her own desktop.
10) Automatic Parameterization of Steps:
We can instruct QTP to automatically parameterize the steps in our tests actions at the end of a
recording session.
This enables us to create actions that can be used for a variety of dierent purposes or scenarios by
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
16 of 165 8/12/2014 6:10 PM
referencing dierent sets of data.
We activate this option by selecting the Automatically parameterize steps option in the General tab of
the Options dialog box. We can set the option to use Global Data Table Parameters or Test Parameters.
When we stop a recording session while this option is selected, QTP replaces the constant values in the
test object operation arguments of our steps with either Data Table parameters or action parameters,
based on our selection in the Options dialog box.
QTP performs this automatic parameterization for all relevant steps in any action in our test, in which
we recorded one or more steps during that recording session.
If we work with HP ALM, and we select the Global Data Table Parameters option, we can map the
generated parameters to the column names of a data resource and then use dierent congurations in
our test sets.
11) New Visual relation identiers:
We can now use visual relation identiers to identify application objects based on other objects that are
always near them.
This enables us to create a more reliable identication denition for test objects that are otherwise
dicult to dierentiate, and to ensure that the identication remains reliable even if the user interface
design changes.
The Visual Relation Identier Dialog Box provides the interface and tools to help us create and verify
our visual relation identier denitions.
12) Visual indication of Version Control Status of Tests:
If we are working with version control in HP ALM or Quality Center, QTP provides a visual indication
to show us when an asset is checked into or out of a project.
Tests, components, and function libraries that are part of version controlled projects stored in HP ALM
or Quality Center display an icon and/or text in the title bar, indicating their version control status.
13) Web 2.0 add-ins support:
QTP 11.0 provides Web Add-in Extensibility-based add-ins for ASP .NET Ajax, GWT, Yahoo UI, and
Dojo Web 2.0 toolkits.
We can use these add-ins just as we would any other add-in. We can also use Web Add-in Extensibility
or Extensibility Accelerator to customize the provided support to match our needs.
We install these add-ins by running the Web 2.0 Toolkit Support Setup from the Add-in Extensibility
and Web 2.0 Toolkits option in the QTP setup window.
The operations supported for each Web 2.0 test object class are a combination of custom operations
developed for that test object class and operations directly inherited from the corresponding (base) Web
Add-in test object class.
14) New capabilities for working with Web-Based objects:
Following new testing capabilities are now available handling Web-Based objects.
a) Firefox Testing: Us can now record steps on Mozilla Firefox and use the.Object property to access the
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
17 of 165 8/12/2014 6:10 PM
Firefox DOM.
b) XPath, CSS, Identiers: Us can add the XPath or CSS identier properties to instruct QTP to identify a
Web object in our application based on its XPath location or CSS denition.
c) Event Identiers: Us can also now use the aribute/* notation in the test object description to identify
a Web-based object based on an event associated with that object. For example, us can add
aribute/onClick as a property in a WebBuon test object description to identify a buon that is
associated with the onClick event.
d) Embed or Run JavaScripts in our Web Pages: We can use the new EmbedScript/EmbedScriptFromFile
and RunScript/RunScriptFromFile functions to embed JavaScripts in all loaded browser pages and
frames or to run JavaScripts in specic pages. Use these scripts to perform operations on, or retrieve data
from, the browser pages in our application.
15) New methods for testing Web-based Operations:
The following methods are available to test Web-based applications:
AnyWebBasedObject.RightClick / MiddleClick
Brower.ClearCache
Browser.DeleteCookies
16) New LoadFunctionLibrary statement:
The new LoadFunctionLibrary statement lets us load a function library when a step runs instead of at
the beginning of a run session. This means, for example, that us can dene conditional steps that use
functions from various function libraries, but load only the required function libraries during a run
session.
17) Improved checkpoints and output value objects management:
We can now manage checkpoints and output value objects when comparing, merging, and exporting
object repositories just like any other test object, including ltering, searching, and conict resolution.
18) Dual Monitor Support:
QTP recognizes objects across multiple monitors, meaning that our application display no longer needs
to be limited to one screen. Alternatively, we can view QTP on one monitor while the steps run on our
application on another monitor.
19) New QTP Asset Upgrade Tool for HP ALM and Quality Center:
The QTP Asset Upgrade Tool for HP ALM/Quality Center enables us to upgrade, in a batch, all the QTP
assets in an HP ALM or Quality Center 10.00 project from QTP 9.5 or earlier to the current format and to
convert testing document aachments to the resources and dependencies model.
The QTP Asset Upgrade Tool for HP ALM/Quality Center also enables us to upgrade our tests to use the
new test congurations feature. If our tests contain data table parameters that are stored in the Global
sheet of a QTP data table, this tool copies those data table parameters to our HP ALM or Quality Center
project, enabling us to start working with HP ALM test congurations.
20) Test execution in minimized remote desktop protocol session:
We can now run QTP in a minimized RDP (remote desktop protocol) session in an RDP 6.0 or later client
by seing a registry value on the remote computer.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
18 of 165 8/12/2014 6:10 PM
21) Improved Web Add-in Extensibility:
We can now develop browser-independent Web Add-in Extensibility support sets that support testing
custom controls on both Internet Explorer and Firefox, and on dierent versions of these browsers.
We can introduce external JavaScript libraries in our Web Add-in Extensibility support sets, enabling us
to call their functions from within the JavaScript functions we develop to support custom controls.
QTPs performance when learning, spying, and running steps on controls supported by Web Add-in
Extensibility is improved.
22) Improved Business Process Testing:
QTP 11.0 provides the following enhancements for business process testing when working with HP
ALM:
# Improved performance.
# Application areas are now stored in the HP ALM Test Resources module as resources.
This enables us to apply version control to an application area, view at a glance which components are
using a specic application area, see which resource les are associated with a particular application
area, share our application areas with other projects, and so on.
# Local system monitoring is now supported for component runs.
# All component parameters in HP ALM are now inserted as string value types. From HP ALM, we can
use options to encrypt these parameter values or to apply dynamic date values.
23) New QTP-Service Test integration Facility:
The new QTP-Service Test integration enables us to test across the GUI and non-GUI layers of our
application.
We can use QTP steps to start testing the GUI elements in our application, then call a Service Test to
validate service communications (standard Web Services, non-SOAP Web Services, such as REST, etc.),
and then step back into our QTP GUI testing, all in a single test run.
The results of the QTP and Service Test steps are displayed in a unied report in the new Run Results
Viewer.
24) New Extensibility Accelerator for Functional Testing:
The new Extensibility Accelerator for Functional Testing is a Visual Studio-like IDE that facilitates the
design, development, and deployment of Web Add-in Extensibility support.
It provides a user interface and special tools that help us dene new test object classes, map those test
object classes to the controls in our application, and teach QTP how to identify the controls, perform
operations on the controls and retrieve their properties.
We install the Extensibility Accelerator from the Add-in Extensibility and Web 2.0 Toolkits option in the
QTP Professional setup window.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
19 of 165 8/12/2014 6:10 PM
Release Locked QTP Tests from QC
30 JUL 2012 Leave a comment
by vsprasad2k in QTP QC ISSUES
Execute the below Script,
Set QCConnection=QCUtil.QCConnection
Set con=QCConnection.command
con.CommandText=DELETE FROM LOCKS WHERE LK_USER = USERID
Set recset=con.execute
*Mention your QC USER ID in above code
***********************************************************************************************
you can nd this info. in QC Site Conguration TAB (Use QC Admin login) , Lock_TimeOut option
Working on Windows Shell, Registy keys and TextUtil
using QTP
17 JUL 2012 Leave a comment
by vsprasad2k in COM DCOM AOM, QTP, QTP Registry, QTP Tricks Tags: QTP RegEdit
Change the Registry Key Values:
f_WriteRegEdit(HKCUControl PanelInternationalsShortDate,datatable(DateFormat),REG_SZ)
Function f_WriteRegEdit(strKeyPath,strKeyVal,strValType)
Set WshShell = CreateObject(WScript.Shell)
WshShell.RegWrite strKeyPath, strKeyVal, strValType
End Function
msgbox f_ReadRegEdit(HKCUControl PanelInternationalsShortDate)
Function f_ReadRegEdit(strKeyPath)
Set WshShell = CreateObject(WScript.Shell)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
20 of 165 8/12/2014 6:10 PM
f_ReadRegEdit=WshShell.RegRead (strKeyPath)
End Function


How to make QC Status incomplete, during script execution:
Reporter.ReportEvent micPass,test,test
Set WshShell = CreateObject(WScript.Shell)
WshShell.SendKeys {F4}
Reporter.ReportEvent micPass,test,test

Window or Page is not recognizing ???? you may use shell scripting and textutil.GetText to avoid
such situations
Let me know if you have any issues using the code
Set WshShell = CreateObject(WScript.Shell)
WshShell.SendKeys {TAB 1}
WshShell.SendKeys some data
msgbox textutil.GetText(1704986)

VBScript code snippet to execute a Stored Procedure using
ADO object
17 JUL 2012 Leave a comment
by vsprasad2k in QTP, QTP ADODB
Connect to server to audit
Set MyProdServer = CreateObject(ADODB.Connection)
Set MyProdServerCMD = CreateObject(ADODB.Command)
Set MyProdServerRS = CreateObject(ADODB.Recordset)
MyProdServer.Provider = sqloledb
MyProdServer.ConnectionString = server= & sServerNameSource &
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
21 of 165 8/12/2014 6:10 PM
;Database=admin;Trusted_Connection=yes;
MyProdServer.Open
MyProdServerCMD.ActiveConnection = MyProdServer
MyProdServerCMD.CommandText = sp_who3
MyProdServerCMD.CommandType = adCmdStoredProc
Set MyProdServerRS = MyProdServerCMD.Execute
If MyProdServerRS.State = adStateClosed Then
logFile.WriteLine(No results returned & Now())
Else
MyProdServerRS.MoveFirst
While MyProdServerRS.EOF = False
sSPID = MyProdServerRS(SPID)
sCmdText = MyProdServerRS(CommandText)
sLogin = MyProdServerRS(Login)
sHostName = MyProdServerRS(HostName)
sBlkBy = MyProdServerRS(BlkBy)
sDBName = MyProdServerRS(DBName)
sCommand = MyProdServerRS(Command)
sCPUTime = MyProdServerRS(CPUTime)
sDiskIO = MyProdServerRS(DiskIO)
sLastBatch = MyProdServerRS(LastBatch)
sProgramName = MyProdServerRS(ProgramName)
sSpid2 = MyProdServerRS(SPID)
Automation Test Development Strategy is simillar to
SDLC process
12 JUL 2012 Leave a comment
by vsprasad2k in Uncategorized
For the projects who want to make automation testing 100% successful/robust, for the feasibility they
have done follow the below Software Automation Test Development Process [SATDP] with automated
metrics/artifacts which should update the project status as and then at each phase, like resuable
actions/functions/testscripts/OR/libs developed whom, when and what they developed and place the
test results path in excel, beer use Macros..
I will describe the process followed in each phase, soon
Automation Test Feasibility 1.
Automation Test Plan/Plan 2.
Analyse Manual TCs/ Analysis 3.
Test Script Designing/Design 4.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
22 of 165 8/12/2014 6:10 PM
Test Script Development/Code 5.
Business Tests Run/Unit Test 6.
Integrate Business TestScripts,Functions and ReUsable Actions /Integration 7.
Code Optimization/Performation 8.
Batch Execution / Execute 9.
Export/Copy the entire webtable from the webpage into
Excelsheet, using Vb script
12 JUL 2012 Leave a comment
by vsprasad2k in Uncategorized
dim xl set xl=createobject(Excel.Application)
xl.workbooks.open c:/book1.xls
set nsheet=xl.sheets.item(1)
row=Browser(browser).page(page).webtable(table).getroproperty(rows)
cols=Browser(browser).page(page).webtable(table).getroproperty(cols)
for i=0 to row-1
for j=0 to col-1
val=Browser(browser).page(page).webtable (table).getcelldata(i,j)
nsheet.cells(i,j)=val
next
next

Environment(Peportpath)=C:Result.xls
a=Browser(Google).Page(Google).WebTable (index:=0).GetROProperty(outerhtml)
Set FSO = CreateObject(Scripting.FileSystemObject)
Set WriteFile = FSO.CreateTextFile( Environment (Peportpath), True) writeFile.writeLine(a)
writeFile.close
Methods of Reading Data from EXCEL Sheet
-Using VBScript
31 MAY 2012 Leave a comment
by vsprasad2k in QTP, QTP Excel, QTP VBScript
Method #1
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
23 of 165 8/12/2014 6:10 PM
Datatable.Importsheet path of the excel le.xls, source sheet ID/Name, desination sheet ID/Name
Datatable.SetCurrentRow(1) Read Value from First Row
value = datatable.Value(parameterName,Sheet ID/Name)
To Read Value from All the rows
Datatable.Importsheet path of the excel le.xls, source sheet ID/Name, desination sheet ID/Name
For vRow = 1 To Datatable.GetRowCount
Datatable.SetCurrentRow(vRow)
value = datatable.Value(parameterName,Sheet ID/Name)
Next
Method #2
Dim objexcel, objWorkbook, objDriverSheet, columncount, rowcount
set objexcel = Createobject(Excel.Application)
Set objWorkbook = objExcel.WorkBooks.Open(path of the le.xls)
Set objDriverSheet = objWorkbook.Worksheets(name of the sheet / Id of the sheet)
columncount = objDriverSheet.usedrange.columns.count
rowcount = objDriverSheet.usedrange.rows.count
for i = 1 to colunmcount
columnname = objDriversheet.cells(i,1)
if columnname = knowncolumnname then
for j = 1 to rowcount
eldvalue = objdriversheet.cells(j,i)
next
end if
next
Method #3
Function GetDataFromDB (strFileName, strSQLStatement)
Dim objAdCon, objAdRs
Set objAdCon = CreateObject(ADODB.Connection)
objAdCon.Open DRIVER={Microsoft Excel Driver (*.xls)};DBQ=&strFileName & ;Readonly=True
If Err <> 0 Then
Reporter.ReportEvent micFail,Create Connection, [Connection] Error has occured. Error : & Err
Set obj_UDF_getRecordset = Nothing
Exit Function
End If
Set objAdRs = CreateObject(ADODB.Recordset)
objAdRs.CursorLocation=3 set the cursor to use adUseClient disconnected recordset
objAdRs.Open strSQLStatement, objAdCon, 1, 3
MsgBox objAdRs.elds(4).name
While objAdRs.EOF=false
For i=0 to objAdRs.Fields.count
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
24 of 165 8/12/2014 6:10 PM
Msgbox objAdRs.elds(i)
Next
objAdRs.moveNext
Wend
If Err<>0 Then
Reporter.ReportEvent micFail,Open Recordset, Error has occured.Error Code : & Err
Set obj_UDF_getRecordset = Nothing
Exit Function
End If
Set objAdRs.ActiveConnection = Nothing
objAdCon.Close
Set objAdCon = Nothing
End Function
Example
Set rsAddin = GetDatasFromDB(C:Documents and SeingsgrameshDesktopLogin.xls, Select * from
[Login$])
VBScript to open excel spreadsheet, update cell, save
then close
12 MAY 2012 Leave a comment
by vsprasad2k in QTP Excel, QTP Tricks, QTP VBScript, Uncategorized
Set objExcel = CreateObject(Excel.Application)
Set objWorkbook = objExcel.Workbooks.Open(C:test.xls)
objExcel.Application.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = Test value
objExcel.ActiveWorkbook.SaveAs C:test.xls
objExcel.ActiveWorkbook.Close
objExcel.Application.Quit
BPT running in an infinite loop, when using QTP 11 QC11
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
25 of 165 8/12/2014 6:10 PM
15 APR 2012 Leave a comment
by vsprasad2k in challenges, QTP, QTP Patch, QTP Tricks Tags: bpt, QTP 11.0 Patch
BPTs running in an innite loop? Going crazy trying to gure out the solution for it?
Its Patch QTP_00821
HP has just released a critical patch for people using QuickTest Professional 11 and ALM/QC 11.00 with
BPT. The patch resolves an issue with seings that were setup for normal QTP test were sometimes
incorrectly applied to a Business Process Test run. These seing caused the BPT to run in an innite
loop.
Patch QTP_00821 (hp://support.openview.hp.com/selfsolve/document
/FID/DOCUMENTUM_QTP_00821) can be downloaded from HP.

Avoid system lock during Automation Test Script Execution
21 MAR 2012 Leave a comment
by vsprasad2k in Uncategorized
There are few ways to prevent windows to lock the system:
Way1:
Download the software Caeine 1.4 (hp://download.cnet.com/Caeine/3000-2094_4-10914397.html)
and install on the machine where u run the scripts.
Way 2:
Create a .vbs le (with the below mentioned code) and a task in task scheduler
Const DELAY_MINUTES = 10
Wscript.Sleep DELAY_MINUTES * 60000
Do
CreateObject(Wscript.Shell).SendKeys +
Wscript.Sleep DELAY_MINUTES * 60000
Loop
Way 3:
Create a .vbs le (with the below mentioned code) and a task in task scheduler
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
26 of 165 8/12/2014 6:10 PM
Const micVoid = 0
Const micByte = 26
Const micLong = 3
Const KEYEVENTF_KEYUP = &H2
Set Extern = CreateObject("Mercury.ExternObj")
extern.Declare micVoid, "keybd_event", "user32", "keybd_event", micByte, micbyte,
miclong, micLong
Extern.Declare micVoid, "Sleep", "kernel32", "Sleep", micLong
While True
extern.keybd_event 0, 0, KEYEVENTF_KEYDOWN, 0
Extern.Sleep 20000
Wend
-********************-*****************-*****************************-*********************************-***************
**************
We can even run the scripts when the system is locked, but QTP may not replay constantly on a locked
machine
The Quick Test Professional computer is locked or logged o.
Quick Test Professional was launched without permission to interact with the desktop.
The following registry key which enables you to run tests on a remote computer, even on an
incompatible execution environment:
HKEY_CURRENT_USERSoftwareMercury InteractiveQuick Test
ProfessionalMicTestSkipEnvironmentChecks
Set the registry key to 1 to prevent the remote execution checks, and 0 to perform the checks.
system lock during QTP Automation Test Script Execution
21 MAR 2012 1 Comment
by vsprasad2k in Uncategorized
There are few ways to prevent windows to lock the system:
Way1:
Download the software Caeine 1.4 (hp://download.cnet.com/Caeine/3000-2094_4-10914397.html)
and install on the machine where u run the scripts.
Way 2:
Create a .vbs le (with the below mentioned code) and a task in task scheduler
Const DELAY_MINUTES = 10
Wscript.Sleep DELAY_MINUTES * 60000
Do
CreateObject(Wscript.Shell).SendKeys +
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
27 of 165 8/12/2014 6:10 PM
Wscript.Sleep DELAY_MINUTES * 60000
Loop
Way 3:
Create a .vbs le (with the below mentioned code) and a task in task scheduler
Const micVoid = 0
Const micByte = 26
Const micLong = 3
Const KEYEVENTF_KEYUP = &H2
Set Extern = CreateObject("Mercury.ExternObj")
extern.Declare micVoid, "keybd_event", "user32", "keybd_event", micByte, micbyte,
miclong, micLong
Extern.Declare micVoid, "Sleep", "kernel32", "Sleep", micLong
While True
extern.keybd_event 0, 0, KEYEVENTF_KEYDOWN, 0
Extern.Sleep 20000
Wend
-********************-*****************-*****************************-*********************************-***************
**************
We can even run the scripts when the system is locked, but QTP may not replay constantly on a locked
machine
The Quick Test Professional computer is locked or logged o.
Quick Test Professional was launched without permission to interact with the desktop.
The following registry key which enables you to run tests on a remote computer, even on an
incompatible execution environment:
HKEY_CURRENT_USERSoftwareMercury InteractiveQuick Test
ProfessionalMicTestSkipEnvironmentChecks
Set the registry key to 1 to prevent the remote execution checks, and 0 to perform the checks.
QTP Mercury Device Replay
21 MAR 2012 Leave a comment
by vsprasad2k in challenges, COM DCOM AOM, QTP, QTP Tricks, QTP VBScript Tags: QTP Mercury
DeviceReplay
In Order to use the DeviceReplay methods, you need to create DeviceReplay object.
Set objDeviceReplay = CreateObject(Mercury.DeviceReplay)
We use SendKeys method to send keyboard input/keystrokes to applications that dont have automation
interface. We can also send more than one keystroke at a time using Sendkeys method. To send
keystrokes x,y and z, you would send the string argument xyz.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
28 of 165 8/12/2014 6:10 PM
Note: You cannot send Print Screen key to an application.
So, the dierence between Mercury DeviceReplay and Sendkeys is
SendKeys -> Support only Keyboard Operations
DeviceReplay-> Support Keyboard + Mouse Operations like Drag Drop too.
In addition to that DeviceReplay supports sending multilingual characters and symbols, while sendkeys
support limited keyboard operations.
The other operational dierence is dependency on QTP software.
Mercury.DeviceReplay :- It comes with QTP as a module, so you need QTP on the system and only from
QTP action you can use it.
SendKeys :- It could be used in VBS script to simulate keyboard inputs with native windows shell
commands. It has no dependency on QTP as such.
Mercury DeviceReplay is a powerful utility to simulate keyboard input and also for simulating mouse
clicks and movements. Under Java Add-in, you can nd the DeviceReplay property. At times, Object.Set
and Object.Type doesnt help in QTP for some applications. You can use Mercury DeviceReplay to type
Non English symbols and leers even without changing the keyboard layout or installing the special
fonts.
Methods
MouseMove x, y {Move the mouse to the screen coordinate (x,y).} 1.
MouseClick x, y, buon {Move the mouse to the screen coordinate (x,y) and click the buon}
(0=left; 1=middle; 2=right).
2.
MouseDblClick x, y, buon {Move the mouse to the screen coordinate (x,y) and double-click the
buon}(0=left; 1=middle; 2=right).
3.
DragAndDrop x, y, dropx, dropy, buon {Drag the mouse from screen coordinate (x,y) to
(dropx,dropy) with the buon}(0=left; 1=middle; 2=right) pressed.
4.
PressKey key {Press a key using the ASCII code of the key.}For example, Chr(13), vbCR and
vbTab.
5.
MouseDown x, y, buon { Press the mouse buon on screen coordinate (x,y).} 6.
MouseUp x, y, buon {Release the mouse buon on screen coordinate (x,y).} 7.
KeyDown key {Press a key using the ASCII code of the key.}For example, Chr(13), vbCR
and vbTab.
8.
KeyUp key {Release a key using the ASCII code of the key.}For example, Chr(13),
vbCR and vbTab.
9.
SendString string {Type a string.} 10.
QTP Mercury Device Replay vs WScript SendKeys Method
21 MAR 2012 Leave a comment
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
29 of 165 8/12/2014 6:10 PM
by vsprasad2k in challenges, COM DCOM AOM, QTP, QTP Tricks, QTP VBScript
In Order to use the DeviceReplay methods, you need to create DeviceReplay object.
Set objDeviceReplay = CreateObject(Mercury.DeviceReplay)
We use SendKeys method to send keyboard input/keystrokes to applications that dont have automation
interface. We can also send more than one keystroke at a time using Sendkeys method. To send
keystrokes x,y and z, you would send the string argument xyz.
Note: You cannot send Print Screen key to an application.
So, the dierence between Mercury DeviceReplay and Sendkeys is
SendKeys -> Support only Keyboard Operations
DeviceReplay-> Support Keyboard + Mouse Operations like Drag Drop too.
In addition to that DeviceReplay supports sending multilingual characters and symbols, while sendkeys
support limited keyboard operations.
The other operational dierence is dependency on QTP software.
Mercury.DeviceReplay :- It comes with QTP as a module, so you need QTP on the system and only from
QTP action you can use it.
SendKeys :- It could be used in VBS script to simulate keyboard inputs with native windows shell
commands. It has no dependency on QTP as such.
Mercury DeviceReplay is a powerful utility to simulate keyboard input and also for simulating mouse
clicks and movements. Under Java Add-in, you can nd the DeviceReplay property. At times, Object.Set
and Object.Type doesnt help in QTP for some applications. You can use Mercury DeviceReplay to type
Non English symbols and leers even without changing the keyboard layout or installing the special
fonts.
Out of Mercury DeviceReplay and SendKeys, which one should I use for Automation testing with QTP?
1. Depends on your objective like mouse operations & multilingual testing required.
2.In case of normal keyboard operations supported by both, SendKeys is easy to use due to English like
syntax for keyboard input. Whereas for devicereplay you need to dene user friendly names/constants
(like VK_SHIFT etc) to numeric keycodes.
QTP Dot Net addin seems to have an issue with NET
4.0 applications.
15 MAR 2012 Leave a comment
by vsprasad2k in Uncategorized
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
30 of 165 8/12/2014 6:10 PM
Till .NET 3.5 and below, it was working ne. However, objects from .NET 4.0 application is showing a
very strange behavior. Most of the objects are geing recognized as SwfObjects.
Till .NET 3.5 and below, we could get the hierarchy as:
SwfWindow().SwfBuon()
After moving to .NET 4.0, we are geing hierarchy like this:
Window().SwfObject()
Now the question arises
Why SwfWindow objects are being viewed as Window. We have done the installation of .NET
framework 4.0 very recently.
The solution / answer goes like this:
The .NET Framework version 4.0 was installed after QuickTest Professional was installed which is the
possible issue for this QTP behavior.
When you desire to work on .NET 4.0, then its beer to rstly install this before the installation of
QuickTest Professional. If .NET 4.0 is installed after QuickTest, then you need to register following two
.NET DLL les as per the procedure given below.:
1. If working on a 64 bit operating system, you will be required to install patch QTP_00709.
2. Open a command prompt (Start > Run > type cmd > Click Ok)
3. Navigate toGlobalAssemblyCacheNet4
4. Run the following two commands:
1. .binGACRegUtil4x86.exe -i Mercury.QTP.Agent.dll
2. .binGACRegUtil4x86.exe -i Mercury.QTP.WpfAgent.dll
The above mentioned steps should x this issue.
However, just in case if it doesnt happen, we would recommend to carryout clean uninstalling of HP
QuickTest Professional.
Object Identification issue with IE8 and IE9 on QTP11.0
15 MAR 2012 Leave a comment
by vsprasad2k in COM DCOM AOM, QTP, QTP Tricks, Uncategorized
Tool: QTP 11.0
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
31 of 165 8/12/2014 6:10 PM
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 Seings and navigate to the Web tab
and change the seings from a specic browser seings to Record on
any open browser seing and then try recording or recognizing
objects.
Reason for not working:
a. QTP needs Admin level privileges to some of its les/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 seing 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:
hp://support.openview.hp.com/selfsolve/document/KM743912 (hp://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 Hewle-Packard Development Company, L.P.
========================================================================
QTPWEB_00037 Support for Internet Explorer 8
========================================================================
This patch provides ocial 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.)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
32 of 165 8/12/2014 6:10 PM
b. For Windows 7.0 qtp_00644.exe.
2. Try the below seings:
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 Seings>>Change User Account Control
seings>>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
le with IE 8.
Note: Ocial Support for IE8 is QTP 10.0 with Patch QTPWEB_00037.
QTP Object Identification issue with IE8 and IE9
on QTP11.0
15 MAR 2012 Leave a comment
by vsprasad2k in COM DCOM AOM, QTP, QTP Tricks, Uncategorized
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 Seings and navigate to the Web tab
and change the seings from a specic browser seings to Record on
any open browser seing and then try recording or recognizing
objects.
Reason for not working:
a. QTP needs Admin level privileges to some of its les/registry
options to perform its functionality.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
33 of 165 8/12/2014 6:10 PM
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 seing 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:
hp://support.openview.hp.com/selfsolve/document/KM743912 (hp://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 Hewle-Packard Development Company, L.P.
========================================================================
QTPWEB_00037 Support for Internet Explorer 8
========================================================================
This patch provides ocial 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 seings:
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 Seings>>Change User Account Control
seings>>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
le with IE 8.
Note: Ocial Support for IE8 is QTP 10.0 with Patch QTPWEB_00037.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
34 of 165 8/12/2014 6:10 PM
QTP VB Script Class Object Example
16 SEP 2011 Leave a comment
by vsprasad2k in QTP
Class User
declare private class variable
Private m_userName
declare the property
Public Property Get UserName
UserName = m_userName
End Property
Public Property Let UserName (strUserName)
m_userName = strUserName
End Property
declare and dene the method
Sub DisplayUserName
Response.Write UserName
End Sub
End Class
After you have declared your Class, then, as demonstrated below, you may create an instance of that
Class (i.e., object) using Set and New.
Use of Class
Dim objUser
Set objUser = New User
set the UserName property
objUser.UserName = The Guru
call the DisplayUserName method
to print the user name
objUser.DisplayUserName
Output:
The Guru
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
35 of 165 8/12/2014 6:10 PM
Designing QTP Framework
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized Tags: QTP Framework
What is framework?
Automation Framework is a set of guidelines and process you use to manage and optimize your
automation testing. In simple words, Framework is a way to do the things in fashioned and organized
manner! Framework is nothing but a concept.
Its always possible to work without framework but youll be doing a lot of rework, everything will be
here & there and in most of the time you will end-up with a mess, specially in the large projects.
Framework lets you predene your automation plans, strategies and how you are going to proceed.
Types of Framework:
Framework can be of several types, but here are three main types of frameworks-
1. Keyword driven framework
2. Data driven framework
3. Hybrid framework
But this is only theoretical. Practically, there is no Chinese Wall between the framework types.
In every organization you work, youll nd that its quite dierent from the other and not only on
organization level, you can feel the dierence within dierent projects!
Yess, but most of the them could be mapped with Hybrid type and I like it!!
Hybrid framework has no boundaries and open to take benet of all possible type of frameworks.
How to design a framework?
I have done a lot of automation projects and designed a lot a frameworks, but seriously guys, I never
used any particular type of framework!
Practically, every application/project has its own expectation. You just need to start your work in
organized way and believe me friends, at the end of the day; your framework will be ready
automatically!! Sounds crazy??
You cant design a complete framework and then start automation! You start automation and framework
will start building simultaneously.
The rst step of any test automation framework is to do a quick POC with few high priority test cases. By
doing POC, you will identify the object identication issues, challenges, complexities, required test-data
and limitation you have. Once you are ready with this information, you can proceed with next steps. On
the basis of above information, you can decide what type of framework is most suitable to you.
But before starting, you must take some time to decide your strategies about..
1. Object Identication
2. Test-Data
3. Function Library
:)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
36 of 165 8/12/2014 6:10 PM
4. Error Handling
5. Controller script
6. Documents and Manuals
1. Object Identication:
How to identify objects i.e. using Object Repository or Descriptive programming or both. As per my
understanding, dontt try to stick on one particular. Depending on the application/object types, mixed
approach is most fruitful most of the time.
2. Test-Data:
How to manage you data? DataTable or Excel or may be at/csv les.
3. Function Library:
Be clear about what type of function libraries you are going to use and why.
4. Error Handling:
Whets your plan to handle errors? Be clear about it.
5. Controller script:
Design a controller script, which will control all your automation. It should be neat. This helps to
understand what actually you are going to call.
6. Documents and Manuals:
Keep all the documentation, user guide/manuals, keywords descriptions here.
Create dierent folder for the these six things and keep data in folders accordingly.
This was the one part.
Apart from this, from rst day of your automation, keep only one thing in your mind.. follow general
good practices!
Here are are few points need to be take care in designing successful framework.
Try to document each and every thing, as much as you can! like comments in script, modication etc.
Dont stick with any particular object identication, use mix of OR and DP
While using OR, dont use record and playback, just add object in the object repository and code the
script manually.
Follow proper Naming-Conventions for all your variables, functions, les.
Dene all the variables in you scripts, use Option Explicit.
Try to keep you functions small to enhance reusability and portability.
Never hard code any data in the scripts, use parametrization.
Take regular back-up of your work.
QTP 11.0 Key Features Enhanced
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
The key enhancements in QTP 11.0 include the following:
1) Support for new Operating Systems:
QTP 11.0 has added new support for the following operating systems:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
37 of 165 8/12/2014 6:10 PM
a) Windows 7
b) Windows Vista SP2
c) Windows Server 2008 SP2
d) Windows Server 2008 R2
2) Enhanced Data Management Facility:
QTP is now seamlessly integrated with HP ALM (Application Lifecycle Management) software. Quality
Center (HP ALM) test conguration functionality enables us to determine at runtime which data sets to
use for our tests.
ALM test congurations enable us to:
a) Unbind our data from our tests
b) Share common data sources across dierent tests
c) Filter our data to t our testing needs
d) Increase requirements traceability
e) We store the data for our tests in the Quality Center Test Resources module in the form of data table
resource les.
We can then dene multiple test congurations for a test in the Test Plan module. When working with
data-driven QTP tests in HP ALM, each conguration is a QTP test that is set to run with a selected data
resource le and optional data lter seings.
One or more specic congurations of the test can be included in a Test Set to cover dierent parts of a
requirement or to cover multiple requirements.
By using Quality Center test congurations, we can create more generic tests and reuse them by
associating a dierent set of data with each. We can also reuse our data by associating the same data
table le with multiple tests.
3) New Object Spy Functionality:
The Object Spy has the following new features:
a) Add an object to a repository: We can now add an object to the object repository directly from the
Object Spy.
b) Highlight an object in our application: When we select a test object in the Object Spy Object hierarchy
tree, we can then select to highlight the object in our application that corresponds to that test object.
c) Copy/paste object properties: We can copy the identication properties and values of a selected test
object in the Object Spy and paste the details into any document. The details are formaed in
programmatic description syntax. This option is especially useful if we want to compare the properties
and values of two objects in our application or when creating programmatic descriptions.
Additionally, the Object Spy has a new, cleaner look and feel:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
38 of 165 8/12/2014 6:10 PM
4) New Smart Regular Expression list:
The Smart Regular Expression list provides syntax hints that make it easier than ever to insert regular
expressions into our test steps. It also enables us to access the Regular Expression Evaluator, which lets
us test regular expressions to make sure they suit our needs.
5) New QTP-Service Test integration facility:
Now we can test our GUI and UI-Less Application Functionality in One Test. We can use QTP steps to
start testing the GUI elements in our application, then call a Service Test test to validate service
communications (standard Web Services, non-SOAP Web Services, such as REST, etc.), and then step
back into our QTP GUI testing, all in a single test run.
The results of the QTP and Service Test steps are displayed in a unied report in the new Run Results
Viewer.
6) New Run Results Viewer:
The new Run Results Viewer provides an Executive Summary page with summary data, pie charts and
statistics for both the current and previous runs, a quick link to the previous run results, and more.
The Run Results Viewer displays the results of our run session in a set of panes that we can show, hide,
move, dock, and otherwise customize to our needs.
We can install the Run Results Viewer as a standalone installation. This enables us to share the results of
our tests with business analysts and developers who do not work with QTP.
7) New facility to hide the Keyword View:
If we prefer working only with the Expert View, we can now use an option in the Options dialog box to
hide the Keyword View so that only the Expert View is displayed when we open QTP Professional.
Facility to add Images to Our Run Results:
We can now add a Reporter.ReportEvent statement that includes an image le path. This lets us add an
image to the run results wherever one is needed.
9) New Log Tracking Functionality:
QTPs new Log Tracking functionality helps us work with developers to pinpoint the root causes of
unexpected behavior in our application.
When we enable log tracking, QTP receives the Java or .NET log framework messages from our
application and embeds them in the run results.
We can click a log message in the results to jump to the relevant step in the run results tree, or we can
click a step in the run results tree and view the log message that was generated at the time that the
selected step ran. We can also specify that a log message of a particular level (or higher) will fail our test.
After we view the results, we can print or export the log tracking details to a le to show to a developer,
or we can provide the developer with the standalone Run Results Viewer installation so that the
developer can view and analyze the results directly on his or her own desktop.
10) Automatic Parameterization of Steps:
We can instruct QTP to automatically parameterize the steps in our tests actions at the end of a
recording session.
This enables us to create actions that can be used for a variety of dierent purposes or scenarios by
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
39 of 165 8/12/2014 6:10 PM
referencing dierent sets of data.
We activate this option by selecting the Automatically parameterize steps option in the General tab of
the Options dialog box. We can set the option to use Global Data Table Parameters or Test Parameters.
When we stop a recording session while this option is selected, QTP replaces the constant values in the
test object operation arguments of our steps with either Data Table parameters or action parameters,
based on our selection in the Options dialog box.
QTP performs this automatic parameterization for all relevant steps in any action in our test, in which
we recorded one or more steps during that recording session.
If we work with HP ALM, and we select the Global Data Table Parameters option, we can map the
generated parameters to the column names of a data resource and then use dierent congurations in
our test sets.
11) New Visual relation identiers:
We can now use visual relation identiers to identify application objects based on other objects that are
always near them.
This enables us to create a more reliable identication denition for test objects that are otherwise
dicult to dierentiate, and to ensure that the identication remains reliable even if the user interface
design changes.
The Visual Relation Identier Dialog Box provides the interface and tools to help us create and verify
our visual relation identier denitions.
12) Visual indication of Version Control Status of Tests:
If we are working with version control in HP ALM or Quality Center, QTP provides a visual indication
to show us when an asset is checked into or out of a project.
Tests, components, and function libraries that are part of version controlled projects stored in HP ALM
or Quality Center display an icon and/or text in the title bar, indicating their version control status.
13) Web 2.0 add-ins support:
QTP 11.0 provides Web Add-in Extensibility-based add-ins for ASP .NET Ajax, GWT, Yahoo UI, and
Dojo Web 2.0 toolkits.
We can use these add-ins just as we would any other add-in. We can also use Web Add-in Extensibility
or Extensibility Accelerator to customize the provided support to match our needs.
We install these add-ins by running the Web 2.0 Toolkit Support Setup from the Add-in Extensibility
and Web 2.0 Toolkits option in the QTP setup window.
The operations supported for each Web 2.0 test object class are a combination of custom operations
developed for that test object class and operations directly inherited from the corresponding (base) Web
Add-in test object class.
14) New capabilities for working with Web-Based objects:
Following new testing capabilities are now available handling Web-Based objects.
a) Firefox Testing: Us can now record steps on Mozilla Firefox and use the.Object property to access the
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
40 of 165 8/12/2014 6:10 PM
Firefox DOM.
b) XPath, CSS, Identiers: Us can add the XPath or CSS identier properties to instruct QTP to identify a
Web object in our application based on its XPath location or CSS denition.
c) Event Identiers: Us can also now use the aribute/* notation in the test object description to identify
a Web-based object based on an event associated with that object. For example, us can add
aribute/onClick as a property in a WebBuon test object description to identify a buon that is
associated with the onClick event.
d) Embed or Run JavaScripts in our Web Pages: We can use the new EmbedScript/EmbedScriptFromFile
and RunScript/RunScriptFromFile functions to embed JavaScripts in all loaded browser pages and
frames or to run JavaScripts in specic pages. Use these scripts to perform operations on, or retrieve data
from, the browser pages in our application.
15) New methods for testing Web-based Operations:
The following methods are available to test Web-based applications:
a) AnyWebBasedObject.RightClick / MiddleClick
b) Brower.ClearCache
c) Browser.DeleteCookies
16) New LoadFunctionLibrary statement:
The new LoadFunctionLibrary statement lets us load a function library when a step runs instead of at
the beginning of a run session. This means, for example, that us can dene conditional steps that use
functions from various function libraries, but load only the required function libraries during a run
session.
17) Improved checkpoints and output value objects management:
We can now manage checkpoints and output value objects when comparing, merging, and exporting
object repositories just like any other test object, including ltering, searching, and conict resolution.
18) Dual Monitor Support:
QTP recognizes objects across multiple monitors, meaning that our application display no longer needs
to be limited to one screen. Alternatively, we can view QTP on one monitor while the steps run on our
application on another monitor.
19) New QTP Asset Upgrade Tool for HP ALM and Quality Center:
The QTP Asset Upgrade Tool for HP ALM/Quality Center enables us to upgrade, in a batch, all the QTP
assets in an HP ALM or Quality Center 10.00 project from QTP 9.5 or earlier to the current format and to
convert testing document aachments to the resources and dependencies model.
The QTP Asset Upgrade Tool for HP ALM/Quality Center also enables us to upgrade our tests to use the
new test congurations feature. If our tests contain data table parameters that are stored in the Global
sheet of a QTP data table, this tool copies those data table parameters to our HP ALM or Quality Center
project, enabling us to start working with HP ALM test congurations.
20) Test execution in minimized remote desktop protocol session:
We can now run QTP in a minimized RDP (remote desktop protocol) session in an RDP 6.0 or later client
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
41 of 165 8/12/2014 6:10 PM
by seing a registry value on the remote computer.
21) Improved Web Add-in Extensibility:
We can now develop browser-independent Web Add-in Extensibility support sets that support testing
custom controls on both Internet Explorer and Firefox, and on dierent versions of these browsers.
We can introduce external JavaScript libraries in our Web Add-in Extensibility support sets, enabling us
to call their functions from within the JavaScript functions we develop to support custom controls.
QTPs performance when learning, spying, and running steps on controls supported by Web Add-in
Extensibility is improved.
22) Improved Business Process Testing:
QTP 11.0 provides the following enhancements for business process testing when working with HP
ALM:
# Improved performance.
# Application areas are now stored in the HP ALM Test Resources module as resources.
This enables us to apply version control to an application area, view at a glance which components are
using a specic application area, see which resource les are associated with a particular application
area, share our application areas with other projects, and so on.
# Local system monitoring is now supported for component runs.
# All component parameters in HP ALM are now inserted as string value types. From HP ALM, we can
use options to encrypt these parameter values or to apply dynamic date values.
23) New QTP-Service Test integration Facility:
The new QTP-Service Test integration enables us to test across the GUI and non-GUI layers of our
application.
We can use QTP steps to start testing the GUI elements in our application, then call a Service Test to
validate service communications (standard Web Services, non-SOAP Web Services, such as REST, etc.),
and then step back into our QTP GUI testing, all in a single test run.
The results of the QTP and Service Test steps are displayed in a unied report in the new Run Results
Viewer.
24) New Extensibility Accelerator for Functional Testing:
The new Extensibility Accelerator for Functional Testing is a Visual Studio-like IDE that facilitates the
design, development, and deployment of Web Add-in Extensibility support.
It provides a user interface and special tools that help us dene new test object classes, map those test
object classes to the controls in our application, and teach QTP how to identify the controls, perform
operations on the controls and retrieve their properties.
We install the Extensibility Accelerator from the Add-in Extensibility and Web 2.0 Toolkits option in the
QTP Professional setup window.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
42 of 165 8/12/2014 6:10 PM
QTP Framework Designing
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
What is framework?
Automation Framework is a set of guidelines and process you use to manage and optimize your
automation testing. In simple words, Framework is a way to do the things in fashioned and organized
manner! Framework is nothing but a concept.
Its always possible to work without framework but youll be doing a lot of rework, everything will be
here & there and in most of the time you will end-up with a mess, specially in the large projects.
Framework lets you predene your automation plans, strategies and how you are going to proceed.
Types of Framework:
Framework can be of several types, but here are three main types of frameworks-
1. Keyword driven framework
2. Data driven framework
3. Hybrid framework
But this is only theoretical. Practically, there is no Chinese Wall between the framework types.
In every organization you work, youll nd that its quite dierent from the other and not only on
organization level, you can feel the dierence within dierent projects!
Yess, but most of the them could be mapped with Hybrid type and I like it!!
Hybrid framework has no boundaries and open to take benet of all possible type of frameworks.
How to design a framework?
I have done a lot of automation projects and designed a lot a frameworks, but seriously guys, I never
used any particular type of framework!
Practically, every application/project has its own expectation. You just need to start your work in
organized way and believe me friends, at the end of the day; your framework will be ready
automatically!! Sounds crazy??
You cant design a complete framework and then start automation! You start automation and framework
will start building simultaneously.
The rst step of any test automation framework is to do a quick POC with few high priority test cases. By
doing POC, you will identify the object identication issues, challenges, complexities, required test-data
and limitation you have. Once you are ready with this information, you can proceed with next steps. On
the basis of above information, you can decide what type of framework is most suitable to you.
But before starting, you must take some time to decide your strategies about..
1. Object Identication
2. Test-Data
3. Function Library
:)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
43 of 165 8/12/2014 6:10 PM
4. Error Handling
5. Controller script
6. Documents and Manuals
1. Object Identication:
How to identify objects i.e. using Object Repository or Descriptive programming or both. As per my
understanding, dontt try to stick on one particular. Depending on the application/object types, mixed
approach is most fruitful most of the time.
2. Test-Data:
How to manage you data? DataTable or Excel or may be at/csv les.
3. Function Library:
Be clear about what type of function libraries you are going to use and why.
4. Error Handling:
Whets your plan to handle errors? Be clear about it.
5. Controller script:
Design a controller script, which will control all your automation. It should be neat. This helps to
understand what actually you are going to call.
6. Documents and Manuals:
Keep all the documentation, user guide/manuals, keywords descriptions here.
Create dierent folder for the these six things and keep data in folders accordingly.
This was the one part.
Apart from this, from rst day of your automation, keep only one thing in your mind.. follow general
good practices!
Here are are few points need to be take care in designing successful framework.
Try to document each and every thing, as much as you can! like comments in script, modication etc.
Dont stick with any particular object identication, use mix of OR and DP
While using OR, dont use record and playback, just add object in the object repository and code the
script manually.
Follow proper Naming-Conventions for all your variables, functions, les.
Dene all the variables in you scripts, use Option Explicit.
Try to keep you functions small to enhance reusability and portability.
Never hard code any data in the scripts, use parametrization.
Take regular back-up of your work.
Problems with QTP 11 Installation
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
44 of 165 8/12/2014 6:10 PM
Notes and Limitations
This section includes the following:
Before You Install
Supplemental Information
Before You Install
This section includes information that is important for you to know before you install QuickTest.
You cannot install QuickTest when a McAfee Anti-Virus application is running.
Workaround: Disable the antivirus application during the QuickTest installation process.
QuickTest Professional supports the Sentinel RMS License Manager version 8.3.0 as its concurrent
license server. Earlier versions of the concurrent license server are not supported.
QuickTest does not support Windows user names with non-English leers. If you log in to Windows
using a user name (with administrative privileges) that contains non-English characters and then
install QuickTest, the installation may complete successfully, but you may not be able to open
QuickTest or it may not behave correctly.
The path in which installation les for QuickTest are located, and the path in which QuickTest is
installed, can contain only English characters.
When upgrading to QuickTest 11.00 from a QuickTest 9.5 or 10.00 installation on which a Language
Pack (localized version of QuickTest) was previously installed, you may get an error message when
opening QuickTest after the upgrade.
Workaround: Repair the installation:
In the Control Panel, select Add/Remove Programs and select the HP QuickTest Professional entry.
Click the Change buon.
In the installation wizard that opens, choose the Repair option and follow the on-screen instructions.
If you install QuickTest 11.00 while the QTPNET_00015 patch (a QuickTest 10.00 patch) is installed
on your computer, QuickTest may behave unexpectedly.
Workaround:
Open the Add/Remove Programs dialog box from the Control Panel.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
45 of 165 8/12/2014 6:10 PM
Display the installed patches by selecting the Show updates check box (or click the View Installed
Updates buon, depending on your operating system version.)
Locate HP QuickTest Professional in the list and check whether QTPNET_00015 for HP QuickTest
Professional 10.00 QFE is listed as an installed update.
If it is installed, click Remove to uninstall this patch before you install QuickTest 11.00.
If you want to work with .NET 4.0, it is best to install it before you install QuickTest. If you install
.NET 4.0 after you install QuickTest, you must manually register two .NET DLLs as follows:
In <QuickTest installation folder>GlobalAssemblyCacheNet4, execute the following commands:
.binGACRegUtil4x86.exe -i Mercury.QTP.Agent.dll
.binGACRegUtil4x86.exe -i Mercury.QTP.WpfAgent.dll
In Windows XP and Windows 2003, if you install the Oracle Add-in, the Windows Remote Shell
Service (rshsvc.exe) may fail and display an error message every time you restart the computer. This
occurs only if the Remote Shell Service is congured to run automatically.
Supplemental Information
Use the information in this section as a supplement to the product documentation.
Additional troubleshooting information, guidelines, and feature-specic limitations are described in the
relevant locations of the installation and product documentation. Make sure you are aware of those
issues when working with the relevant features.
This section includes the following:
Installation
Operating Systems
General
Web Add-in
Silverlight Add-in
Quality Center and Business Process Testing
Documentation
Internationalization
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
46 of 165 8/12/2014 6:10 PM
Installation
When you install a new QuickTest 11.00 installation and you specify a single concurrent license
server in the License Wizard, QuickTest now automatically species the server in an LSFORCEHOST
environment variable, to optimize performance. However if you perform an upgrade from QuickTest
10.00, and you already had an LSHOST variable dened, the upgrade installation does not change
the seing to LSFORCEHOST.
Workaround: If desired, set the LSFORCEHOST variable manually, as described in the HP Functional
Testing Concurrent License Server Installation Guide.
If you manually set an LSHOST environment variable to a particular server (or upgrade from a
previous version of QuickTest where the LSHOST variable was set), QuickTest sometimes gets its
license from another server, even when the specied server has the required licenses available.
Workaround: To ensure that a specic server will be used, specify an LSFORCEHOST environment
variable instead.
Operating Systems
If you work with QuickTest on a Windows 7 operating system with User Account Control (UAC) turned
on, and you open a test from a protected location (such as Program Files), it is opened in read-only
mode and a message is displayed that you do not have permissions to open it in read-write mode.
General
When you save a test using the Save Test with Resources option, it also saves any tests containing
called external actions. However, to preserve space, these called tests contain only the called actions,
and not all of the actions from the original test. Therefore, you cannot open these called tests in
QuickTest from the local copy.
Workaround: If you need to have full access to the called tests as well as the main test that you save
using the Save Test with Resources option, then you must manually save all required tests locally and
then manually edit all references to the relevant actions from the main test to the actions it calls.
Web Add-in
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
47 of 165 8/12/2014 6:10 PM
The If Handler option in the Web Event Recording Conguration dialog box works on Mozilla
Firefox browsers only if the handler is assigned as an aribute (for example, <A onclick = some
code/>) and not if it is assigned as a property (for example, aObj.onclick = function() {some code})
Silverlight Add-in
When Silverlight applications are opened in two tabs sequentially (without QuickTest performing
any operations on the rst one before the second opens), QTP will use a custom server to support
controls only in the rst application with which you interact. The same is true when two tabs are
refreshed sequentially.
Workaround: Perform an operation (for example, use the Object Spy) with the rst tab
opened/refreshed before opening/refreshing the second one.
If a Web page contains a Silverlight application that is windowless and is scrolled out of view when
the page opens the rst time, QuickTest will not be able to make this application visible. (For
example, in this scenario, QuickTest will not be able to perform an SlvWindow.MakeVisible step).
Quality Center and Business Process Testing
When comparing two baselines, if the only change in a resource is its association to a test or
component, the Asset Comparison Tool does not indicate any change in the resource even though
HP ALM or Quality Center may indicate that the resource is Modied.
If an HP ALM or Quality Center user manually changes the status of a test instance run, HP
ALM/Quality Center creates something called fast run results to record the change of the test status.
The fast run results are not valid QuickTest run results les. However, when you try to select results
to open or delete in the Run Results Viewer or Run Results Deletion tool, the fast run results are
available in the list.
After you run a component locally in QuickTest, you cannot use the Jump to Step in QuickTest
option from the Run Results Viewer.
You cannot perform a remote execution of a business process test on a Windows 2008 R2 QuickTest
computer.
Documentation
The QuickTest Help Index tab contains only reference items, such as objects, methods, properties,
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
48 of 165 8/12/2014 6:10 PM
and functions. It does not contain any entries from the user guides.
To search for information from all the documents in the QuickTest Documentation Library, use the
Search tab.
On some operating systems or after installing certain Windows service packs or updates, you may
not be able to view the content of some Help les.
Workaround:
Right-click the CHM le in <QTP installation folder)help, and click Properties.
In the dialog box that opens, click Unblock.
For details, see hp://support.microsoft.com/kb/902225 (hp://support.microsoft.com/kb/902225)
Internationalization
If you are working with a QuickTest User Interface Pack, install it before running QuickTest for the
rst time, if possible.
If you install a QuickTest User Interface Pack after running QuickTest, the following items may remain
in English after installing the User Interface Pack:
Menus and toolbars in the Object Repository window (in QuickTest or in the Object Repository
Manager)
The Find dialog box in the Expert View
Workaround: Close QuickTest and delete the folder: %APPDATA%HPQuickTest Professional
(For example, C:Documents and Seings<username>Application DataHPQuickTest Professional).
When working on an operating system using a Spanish locale, you may get an assertion error
message at the beginning of the QuickTest installation.
Workaround: Modify the sLanguage registry key value as follows:
In the Start > Run dialog box, type: regedit.
Go to the registry path: HKEY_CURRENT_USERControl PanelInternational
Change the sLanguage value from ES to ESN
If the above steps do not solve the problem, restart your computer and try again.
Run the QuickTest installation again.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
49 of 165 8/12/2014 6:10 PM
Selecting the View Sample Snapshot option in the QuickTest Asset Comparison Tool opens a
window containing a sample image of the selected element in QuickTest. The image displays the
English user interface.
The Add-in Extensibility SDKs are not localized.
Working with Windows Registrys Using
DontNetFactory object
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, QTP VBScript, Uncategorized
Creating the .Net Computer object
Set obj = DotNetFactory(Microsoft.VisualBasic.Devices.Computer,Microsoft.VisualBasic)
Set Registry = obj.Registry
IEPathKey =
HKEY_LOCAL_MACHINESOFTWAREMICROSOFTWINDOWSCURRENTVERSIONAPPPATHSIEXP
LORE.EXE
Display the path of IE from Registry
Msgbox Internet Explorer Location & Registry.GetValue(IEPathKey,,)
Registry.SetValue HKEY_CURRENT_USERSoftwareMyApp, Path, C:Test.exe
How to Ping an IP Address using DoNetFactory
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, QTP VBScript, Uncategorized
Creating the .Net Computer object
Set obj = DotNetFactory(Microsoft.VisualBasic.Devices.Computer,Microsoft.VisualBasic)
blnPingSuccess= ob.Ping(127.0.0.1)
Msgbox fnCheckResponse(blnPingSuccess,Ping was Successful,Ping ws Unsuccessful)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
50 of 165 8/12/2014 6:10 PM
Wait for 5 Secs
blnPingSuccess = obj.Ping(127.0.0.1,5000)
Set obj = Nothing

Public Function fnCheckResponse(condition, string1, string2)
If Condition Then
fnCheckResponse =string1
Else
fnCheckResponse =string2
End If
End Function
QTP Working with Windows Registry Using
DontNetFactory object
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, QTP VBScript, Uncategorized
Creating the .Net Computer object
Set obj = DotNetFactory(Microsoft.VisualBasic.Devices.Computer,Microsoft.VisualBasic)
Set Registry = obj.Registry
IEPathKey = HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS
\CURRENTVERSION\APPPATHS\IEXPLORE.EXE
Display the path of IE from Registry
Msgbox Internet Explorer Location & Registry.GetValue(IEPathKey,,)
Registry.SetValue HKEY_CURRENT_USER\Software\MyApp, Path, C:\Test.exe
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
51 of 165 8/12/2014 6:10 PM
Visual Relation Identifier in QTP 11.0
15 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
Visual Relation Identiers will provide a method to identify a object based on the neighbour object
identication properties. This works to the power while working with webtable class in web based
applications. We can dene the visual relationship identiers, which can be set in both local and shared
object repositories.
How Visual Relation Identiers Work:
If you want to identify and click on a class WebCheckBox present in the same row where the main
identier employee ID WebElement is present. Add the employee ID WebElement to QTP object
repository, and add one WebCheckBox class object without any identications properties. Click on the
visual relation identiers buon and provide and select relation details (left and check the horizontal
checkbox and click on OK buon. Now drag the WebElement class into QTP IDE and execute the
statement, it will check the desired check beside that expected Employee ID.
It identies the object based the related object we map to the VRI object, we can specify the 3 dierent
relational details to the both objects based on its position: Left/Right (or) Above/Below (or) Closest to X,
Y/both axis.
Video:
hp://h20621.www2.hp.com/video-gallery/us/en/c3505a334636ac1caa92798d2ab15c85c60b0ca4/r/video
(hp://h20621.www2.hp.com/video-gallery/us/en/c3505a334636ac1caa92798d2ab15c85c60b0ca4/r/video)





Using Descriptive Progamming:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
52 of 165 8/12/2014 6:10 PM
Set rc = VisualRelations.Create
Set relation =
relation.relatedobjectpath = "Bro
relation.relativeposition = micRe
relation.setargument micrelinline
Set des=Description.Create
des.Add "micclass","WebCheckBox"
des.Add "visual relations",rc
Browser("micclass:=Browser").Page
Set relation = Nothing
Set rc=Nothing
QTP 11 Visual Relation Identifier
15 AUG 2011 3 Comments
by vsprasad2k in challenges, QTP, QTP Tricks
Visual Relation Identiers will provide a method to identify a object based on the neighbour object
identication properties. This works to the power while working with webtable class in web based
applications. We can dene the visual relationship identiers, which can be set in both local and shared
object repositories.
How Visual Relation Identiers Work:
If you want to identify and click on a class WebCheckBox present in the same row where the main
identier employee ID WebElement is present. Add the employee ID WebElement to QTP object
repository, and add one WebCheckBox class object without any identications properties. Click on the
visual relation identiers buon and provide and select relation details (left and check the horizontal
checkbox and click on OK buon. Now drag the WebElement class into QTP IDE and execute the
statement, it will check the desired check beside that expected Employee ID.
It identies the object based the related object we map to the VRI object, we can specify the 3 dierent
relational details to the both objects based on its position: Left/Right (or) Above/Below (or) Closest to X,
Y/both axis.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
53 of 165 8/12/2014 6:10 PM
This identication property helps in solving most of the object identication issues in webtable using
QTP and of not demanding much technical knowledge pushing automation to next level.
QTP VB Script Interview Sample Questions and Answers
16 JUL 2011 Leave a comment
by vsprasad2k in QTP VBScript Tags: VB Script Samples
1 Print Hello World
Print Hello World
**************************************************************************
**************************************************************************
2 Find whether given number is a odd number
Dim oNumber
oNumber=4
If oNumber mod 2 <>0 Then
Print The Number & oNumber & is an Odd Number
else
Print The Number & oNumber & is not an Odd Number
End If
**************************************************************************
**************************************************************************
3 Print odd numbers between given range of numbers
Dim RangeStart
Dim RangeEnd
Dim iCounter
RangeStart=10
RangeEnd=20
For iCounter=RangeStart to RangeEnd
If iCounter mod 2 <>0 Then
Print oNumber
End If
Next
**************************************************************************
**************************************************************************
4 Find the factorial of a given number
Dim oNumber
Dim iCounter
Dim fValue
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
54 of 165 8/12/2014 6:10 PM
oNumber=6
fValue=1
For iCounter=oNumber to 1 step-1
fValue=fValue*iCounter
Next
print fValue
**************************************************************************
**************************************************************************
5 Find the factors of a given number
Dim oNumber
Dim iCounter
oNumber=10
For iCounter=1 to oNumber/2
If oNumber mod iCounter=0 Then
print iCounter
End If
Next
print oNumber
**************************************************************************
**************************************************************************
6 Print prime numbers between given range of numbers
Dim RangeStart
Dim RangeEnd
Dim iCounter
RangeStart=1
RangeEnd=30
For iCounter=RangeStart to RangeEnd
For iCount=2 to round(iCounter/2)
If iCounter mod iCount=0 Then
Exit for
End If
Next
If iCount=round(iCounter/2)+1 or iCounter=1 Then
print iCounter
End If
Next
**************************************************************************
**************************************************************************
7 Swap 2 numbers with out a temporary variable
Dim oNum1
Dim oNum2
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
55 of 165 8/12/2014 6:10 PM
oNum1=1055
oNum2=155
oNum1=oNum1-oNum2
oNum2=oNum1+oNum2
oNum1=oNum2-oNum1
print oNum1
print oNum2
**************************************************************************
**************************************************************************
8 Write a program to Perform specied Arithmetic Operation on two given numbers
Dim oNum1
Dim oNum2
Dim oValue
oNum1=10
oNum2=20
OperationtoPerform=div
Select Case lcase(OperationtoPerform)
Case add
oValue=oNum1+oNum2
Case sub
oValue=oNum1-oNum2
Case mul
oValue=oNum1*oNum2
Case div
oValue=oNum1/ oNum2
End Select
print oValue
**************************************************************************
**************************************************************************
9 Find the length of a given string
Dim oStr
Dim oLength
oStr=sudhakar
oLength=len(oStr)
print oLength
**************************************************************************
**************************************************************************
10 Reverse given string
Dim oStr
Dim oLength
Dim oChar
Dim iCounter
oStr=sudhakar
oLength=len(oStr)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
56 of 165 8/12/2014 6:10 PM
For iCounter=oLength to 1 step-1
oChar=oChar&mid(oStr,iCounter,1)
Next
print oChar
**************************************************************************
**************************************************************************
11 Find how many alpha characters present in a string.
Dim oStr
Dim oLength
Dim oChar
Dim iCounter
oStr=su1h2kar
oLength=len(oStr)
oAlphacounter=0
For iCounter=1 to oLength
If not isnumeric (mid(oStr,iCounter,1)) then
oAlphacounter=oAlphacounter+1
End if
Next
print oAlphacounter
**************************************************************************
**************************************************************************
12 Find occurrences of a specic character in a string
Dim oStr
Dim oArray
Dim ochr
oStr=sudhakar
ochr=a
oArray=split(oStr,ochr)
print ubound(oArray)
**************************************************************************
**************************************************************************
13 Replace space with tab in between the words of a string.
Dim oStr
Dim fStr
oStr=Quick Test Professional
fStr=replace(oStr, ,vbtab)
print fStr
**************************************************************************
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
57 of 165 8/12/2014 6:10 PM
**************************************************************************
14 Write a program to return ASCII value of a given character
Dim ochr
Dim aVal
ochr=A
aVal=asc(ochr)
print aVal
**************************************************************************
**************************************************************************
15 Write a program to return character corresponding to the given ASCII value
Dim ochr
Dim aVal
aVal=65
oChr=chr(aVal)
print oChr
**************************************************************************
**************************************************************************
16 Convert string to Upper Case
Dim oStr
Dim uStr
oStr=QuickTest Professional
uStr=ucase(oStr)
print uStr
**************************************************************************
**************************************************************************
17 Convert string to lower case
Dim oStr
Dim lStr
oStr=QuickTest Professional
lStr=lcase(oStr)
print lStr
**************************************************************************
**************************************************************************
18 Write a program to Replace a word in a string with another word
Dim oStr
Dim oWord1
Dim oWord2
Dim fStr
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
58 of 165 8/12/2014 6:10 PM
oStr=Mercury Quick Test Professional
oWord1=Mercury
oWord2=HP
fStr=replace(oStr,oWord1,oWord2)
print fStr
**************************************************************************
**************************************************************************
19 Check whether the string is a POLYNDROM
Dim oStr
oStr=bob
fStr=StrReverse(oStr)
If oStr=fStr Then
Print The Given String &oStr& is a Palindrome
else
Print The Given String &oStr& is not a Palindrome
End If
**************************************************************************
**************************************************************************
20 Verify whether given two strings are equal
Dim oStr1
Dim ostr2
oStr1=qtp
oStr2=qtp
If oStr1=oStr2 Then
Print The Given Strings are Equal
else
Print The Given Strings are not Equal
End If
**************************************************************************
**************************************************************************
21 Print all values from an Array
Dim oArray
Dim oCounter
oArray=array(1,2,3,4,qtp,Testing)
For oCounter=lbound(oArray) to ubound(oArray)
print oArray(oCounter)
Next
**************************************************************************
**************************************************************************
22 Sort Array elements
Dim oArray
Dim oCounter1
Dim oCounter2
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
59 of 165 8/12/2014 6:10 PM
Dim tmp
oArray=array(8,3,4,2,7,1,6,9,5,0)
For oCounter1=lbound(oArray) to ubound(oArray)
For oCounter2=lbound(oArray) to ubound(oArray)-1
If oArray(oCounter2)>oArray(oCounter2+1) Then
tmp=oArray(oCounter2)
oArray(oCounter2)=oArray(oCounter2+1)
oArray(oCounter2+1)=tmp
End If
Next
Next
For oCounter1=lbound(oArray) to ubound(oArray)
print oArray(oCounter1)
Next
**************************************************************************
**************************************************************************
23 Add two 2X2 matrices
Dim oArray1(1,1)
Dim oArray2(1,1)
Dim tArray(1,1)
oArray1(0,0)=8
oArray1(0,1)=9
oArray1(1,0)=5
oArray1(1,1)=-1
oArray2(0,0)=-2
oArray2(0,1)=3
oArray2(1,0)=4
oArray2(1,1)=0
tArray(0,0)=oArray1(0,0)+ oArray2(0,0)
tArray(0,1)=oArray1(0,1)+oArray2(0,1)
tArray(1,0)=oArray1(1,0)+oArray2(1,0)
tArray(1,1)=oArray1(1,1)+oArray2(1,1)
**************************************************************************
**************************************************************************
24 Multiply Two Matrices of size 2X2
Dim oArray1(1,1)
Dim oArray2(1,1)
Dim tArray(1,1)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
60 of 165 8/12/2014 6:10 PM
oArray1(0,0)=8
oArray1(0,1)=9
oArray1(1,0)=5
oArray1(1,1)=-1
oArray2(0,0)=-2
oArray2(0,1)=3
oArray2(1,0)=4
oArray2(1,1)=0
tArray(0,0)=oArray1(0,0)* oArray2(0,0)+ oArray1(0,1)* oArray2(1,0)
tArray(0,1)=oArray1(0,0)* oArray2(0,1)+ oArray1(0,1)* oArray2(1,1)
tArray(1,0)=oArray1(1,0)* oArray2(0,0)+ oArray1(1,1)* oArray2(1,0)
tArray(1,1)=oArray1(1,0)* oArray2(0,1)+ oArray1(1,1)* oArray2(1,1)
**************************************************************************
**************************************************************************
25 Convert a String in to an array
Dim oStr
Dim iCounter
oStr=Quick Test Professional
StrArray=split(oStr)
For iCounter=0 to ubound(StrArray)
print StrArray(iCounter)
Next
**************************************************************************
**************************************************************************
26 Convert a String in to an array using i as delimiter
Dim oStr
Dim iCounter
oStr=Quick Test Professional
StrArray=split(oStr,i)
For iCounter=0 to ubound(StrArray)
print StrArray(iCounter)
Next
**************************************************************************
**************************************************************************
27 Find number of words in string
Dim oStr
Dim iCounter
oStr=Quick Test Professional
StrArray=split(oStr, )
print Theere are &ubound(StrArray)+1& words in the string
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
61 of 165 8/12/2014 6:10 PM
**************************************************************************
**************************************************************************
28 Write a program to reverse the words of a given string.
Dim oStr
Dim iCounter
oStr=Quick Test Professional
StrArray=split(oStr, )
For iCounter=0 to ubound(StrArray)
print strreverse(StrArray(iCounter))
Next
**************************************************************************
**************************************************************************
29 Print the data as a Pascal triangle
The formulae for pascal triangle is nCr=n!/(n-r)!*r!
Dim PascalTriangleRows
Dim nCr
Dim NumCount
Dim RowCount
PascalTriangleRows = 10
For NumCount = 0 To PascalTriangleRows
toPrint= Space(PascalTriangleRows NumCount)
For RowCount = 0 To NumCount
If (NumCount = RowCount) Then
nCr = 1
Else
nCr = Factorial(NumCount) / (Factorial(NumCount RowCount) * Factorial(RowCount))
End If
toPrint=toPrint&nCr&
Next
print toPrint
Next
Function Factorial(num)
Dim iCounter
Factorial = 1
If num <> 0 Then
For iCounter = 2 To num
Factorial = Factorial * iCounter
Next
End If
End Function
**************************************************************************
**************************************************************************
30 Join elements of an array as a string
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
62 of 165 8/12/2014 6:10 PM
Dim oStr
Dim iCounter
oStr=Quick Test Professional
StrArray=split(oStr, )
print join(StrArray, )
**************************************************************************
**************************************************************************
31 Trim a given string from both sides
Dim oStr
oStr= QTP
print trim(oStr)
**************************************************************************
**************************************************************************
32 Write a program to insert 100values and to delete 50 values from an array
Dim oArray()
Dim iCounter
ReDim oArray(100)
For iCounter=0 to ubound(oArray)
oArray(iCounter)=iCounter
Print total 100 Values
print(oArray(iCounter))
Next
print ******************************
print ******************************
ReDim preserve oArray(50)
For iCounter=0 to ubound(oArray)
Print Values after deleting 50 values
print(oArray(iCounter))
Next
**************************************************************************
**************************************************************************
33 Write a program to force the declaration of variables
Option explicit this keyword will enforce us to declare variables
Dim x
x=10
Here we get an error because i have not declared y,z
y=20
z=x+y
print z
**************************************************************************
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
63 of 165 8/12/2014 6:10 PM
**************************************************************************
34 Write a program to raise an error and print the error number.
On Error Resume Next
Err.Raise 6 Raise an overow error.
print (Error # & CStr(Err.Number) & & Err.Description)
**************************************************************************
**************************************************************************
35 Finding whether a variable is an Array
Dim oArray()
if isarray(oArray) then
print the given variable is an array
else
print the given variable is not an array
End if
**************************************************************************
**************************************************************************
36 Write a program to list the Timezone oset from GMT
Dim objWMIService
Dim colTimeZone
Dim objTimeZone
Set objWMIService = GetObject(winmgmts: & {impersonationLevel=impersonate}!\.rootcimv2)
Set colTimeZone = objWMIService.ExecQuery(Select * from Win32_TimeZone)
For Each objTimeZone in colTimeZone
print Oset: & objTimeZone.Bias
Next
**************************************************************************
**************************************************************************
37 Retrieving Time Zone Information for a Computer
Dim objWMIService
Dim colTimeZone
Dim objTimeZone
Set objWMIService = GetObject(winmgmts: & {impersonationLevel=impersonate}!\.rootcimv2)
Set colTimeZone = objWMIService.ExecQuery(Select * from Win32_TimeZone)
For Each objItem in colTimeZone
print Bias: & objItem.Bias
print Caption: & objItem.Caption
print Daylight Bias: & objItem.DaylightBias
print Daylight Day: & objItem.DaylightDay
print Daylight Day Of Week: & objItem.DaylightDayOfWeek
print Daylight Hour: & objItem.DaylightHour
print Daylight Millisecond: & objItem.DaylightMillisecond
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
64 of 165 8/12/2014 6:10 PM
print Daylight Minute: & objItem.DaylightMinute
print Daylight Month: & objItem.DaylightMonth
print Daylight Name: & objItem.DaylightName
print Daylight Second: & objItem.DaylightSecond
print Daylight Year: & objItem.DaylightYear
print Description: & objItem.Description
print Seing ID: & objItem.SeingID
print Standard Bias: & objItem.StandardBias
print Standard Day: & objItem.StandardDay
print Standard Day Of Week: & objItem.StandardDayOfWeek
print Standard Hour: & objItem.StandardHour
print Standard Millisecond: & objItem.StandardMillisecond
print Standard Minute: & objItem.StandardMinute
print Standard Month: & objItem.StandardMonth
print Standard Name: & objItem.StandardName
print Standard Second: & objItem.StandardSecond
print Standard Year: & objItem.StandardYear
Next
**************************************************************************
**************************************************************************
38 Write a program to Convert an expression to a date
Dim StrDate
Dim actualDate
Dim StrTime
Dim actualTime
StrDate = October 19, 1962 Dene date.
actualDate = CDate(StrDate) Convert to Date data type.
print actualDate
StrTime = 4:35:47 PM Dene time.
actualTime = CDate(StrTime) Convert to Date data type.
print actualTime
**************************************************************************
**************************************************************************
39 Display current date and Time
print now
**************************************************************************
**************************************************************************
40 Find dierence between two dates.
Date dierence in Years
print DateDi(yyyy,12/31/2002,Date)
Date dierence in Months
print DateDi(m,12/31/2002,Date)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
65 of 165 8/12/2014 6:10 PM
Date dierence in Days
print DateDi(d,12/31/2002,Date)
**************************************************************************
**************************************************************************
41 Add time interval to a date
print DateAdd(m, 1, 31-Jan-95)
**************************************************************************
**************************************************************************
42 Print current day of the week
Print day(date)
**************************************************************************
**************************************************************************
43 Find whether current month is a long month
Dim oCurrentMonth
Dim ocurrentYear
Dim oDaysinMonths
oCurrentMonth = Month(date)
ocurrentYear = Year(date)
oDaysinMonths=Day(DateSerial(ocurrentYear, oCurrentMonth + 1, 0))
print oDaysinMonths& Days in Current Month
If oDaysinMonths=31 Then
print Current Month is a long month
else
print Current Month is not a long month
End If
**************************************************************************
**************************************************************************
44 Find whether given year is a leap year
1st Method
The rules for leap year:
1. Leap Year is divisible by 4 (This is mandotory Rule)
2. Leap Year is not divisible by 100 (Optional)
3. Leap Year divisble by 400 (Optional)
Dim oYear
oYear=1996
If ((oYear Mod 4 = 0) And (oYear Mod 100 <> 0) Or (oYear Mod 400 = 0)) then
print Year &oYear& is a Leap Year
else
print Year &oYear& is not a Leap Year
End If
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
66 of 165 8/12/2014 6:10 PM
45. 2nd Method
Checking 29 days for February month in specied year
Dim oYear
Dim tmpDate
oYear=1996
tmpDate = 1/31/ & oYear
DaysinFebMonth = DateAdd(m, 1, tmpDate)
If day(DaysinFebMonth )=29 then
print Year &oYear& is a Leap Year
else
print Year &oYear& is not a Leap Year
End If
**************************************************************************
**************************************************************************
46 Format Number to specied decimal places
Dim oNum
Dim DecimaPlacestobeFormat
oNum = 3.14159
DecimaPlacestobeFormat=2
print Round(oNum , DecimaPlacestobeFormat)
**************************************************************************
**************************************************************************
47 Write a program to Generate a Random Numbers
This script will generate random numbers between 10 and 20
Dim rStartRange
Dim rEndRange
rStartRange=10
rEndRange=20
For iCounter=1 to 10
print Int((rEndRange rStartRange + 1) * Rnd + rStartRange)
Next
**************************************************************************
**************************************************************************
48 Write a program to show dierence between Fix and Int
Both Int and Fix remove the fractional part of number and return the resulting integer value.
The dierence between Int and Fix is that if number is negative, Int returns the rst negative integer less
than or equal to number,
whereas Fix returns the rst negative integer greater than or equal to number.
For example, Int converts -8.4 to -9, and Fix converts -8.4 to -8.
print Int(99.8) Returns 99.
print Fix(99.2) Returns 99.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
67 of 165 8/12/2014 6:10 PM
print Int(-99.8) Returns -100.
print Fix(-99.8) Returns -99.
print Int(-99.2) Returns -100.
print Fix(-99.2) Returns -99.
**************************************************************************
**************************************************************************
49 Write a program to nd subtype of a variable
Dim oVar
Dim oDatatypes
oVar=QTP
oVartype=Typename(oVar)
print oVartype
**************************************************************************
**************************************************************************
50 Write a program to print the decimal part of a given number
Dim oNum
oNum=3.123
oDecNum=oNum- int(oNum)
print oDecNum
**************************************************************************
**************************************************************************
Working with ADODB connections using QTP
30 MAY 2009 Leave a comment
by vsprasad2k in QTP ADODB Tags: QTP ADODB
How to open a password-protected database.
Example:
Dim FlightNumber
Dim dbexample
Create the conection object.
Set dbexample = CreateObject(ADODB.Connection)
Set the connection string and open the connection
dbexample.ConnectionString = DBQ=D:Program FilesMercury
InteractiveWinRunnersamplesightappight32.mdb;DefaultDir=D:Program FilesMercury
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
68 of 165 8/12/2014 6:10 PM
InteractiveWinRunnersamplesightapp;Driver={Microsoft Access Driver (*.mdb)};DriverId=281;FIL=MS
Access;MaxBuerSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;
UserCommitSync=Yes;
dbexample.Open
or use this method if a DSN entry was created.
dbexample.Open(DSN=Flight32)
ightnumber = 6195
Get the recordset returned from a select query.
Set recordset = dbexample.Execute(SELECT * from Orders WHERE Flight_Number = &
ightnumber)
Display the results of the query.
msgbox recordset.GetString
Close the database connection.
dbexample.Close
Set dbexample = Nothing
If your query returns several columns, you can use the Fields method to retrieve data from specied
columns in the returned record set.
Example:
Connect to the Flight32 database
Set dbexample = CreateObject(ADODB.Connection)
dbexample.Open(DSN=Flight32)
Perform a query
Set recordset = dbexample.Execute(SELECT * from Orders)
Get the values from the Customer_Name column
while (NOT recordset.EOF)
MsgBox recordset.Fields(Customer_Name)
Move to the next value in the record set
recordset.MoveNext
wend
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
69 of 165 8/12/2014 6:10 PM
Close the database connection.
dbexample.Close
Set dbexample = Nothing
Does QuickTest Professional (QTP) / Unified Functional
Testing (UFT) support Microsoft Virtual PC?
14 FEB 2013 Leave a comment
by vsprasad2k in QTP
Version QTP 9.2 QTP 9.5 QTP 10 QTP 11 UFT 11.5
Microsoft Virtual PC 2004
No Yes Yes Yes Yes (GUI Testing only)
Microsoft Virtual PC 2007
No Yes Yes Yes Yes (GUI Testing only)
Microsoft Virtual PC VMM 2008
No No Yes Yes Yes (GUI Testing only)
Protected: All posts in this Blog
09 FEB 2013 Enter your password to view comments.
by vsprasad2k in COM DCOM AOM, QTP, QTP ADODB, QTP Excel, QTP Patch, QTP QC ISSUES,
QTP Registry, QTP Tricks, QTP VBScript, QTP WMI, Test Results, Web Extensibility Add-in, XML
Compare
Script to upload attachment in QC test lab
05 DEC 2012 Leave a comment
by vsprasad2k in Uncategorized
Dim oCurrentTest,oAachment
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
70 of 165 8/12/2014 6:10 PM
Set oCurrentTest = QCUtil.CurrentTest.Aachments
Set oAachment = oCurrentTest.AddItem(Null)
oAachment.FileName = C:Results.xls
oAachment.Type = 1 oAachment.Post
oAachment.Refresh Set
oAachment =Nothing
Set oCurrentTest =Nothing
Working with WMI (Windows Management Infrastructure)
16 JUL 2012 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, QTP WMI, Uncategorized
Dim ag, AllProcess, AppToRun
AppToRun = ixplore.exe
Flag = Flase
Set AllProcess = GetObject(winmgmts:)
For Each Process In AllProcess.InstancesOf(Win32_process)
If (Instr ((Process.Name), AppToRun) = 1) Then
Print Internet Explorer is running..
Flag = Ture
Exit For
End If
Next
If Flag = Flase Then
Print Internet Explorer not is running..
SystemUtil.Run AppToRun
End If
You can do the same for any process/application. You just need to change the value of AppToRun
variable.
VBScript Code Snippets for storing the QTP Test Results at
:)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
71 of 165 8/12/2014 6:10 PM
our desired central location [FrmWrk-Folder Structure]
11 JUL 2012 Leave a comment
by vsprasad2k in QTP, QTP VBScript, Test Results
launch QTP in such way that it starts by saving results in the desired lcoationhere QTPResultspath is
the location that has been created in QTPResults folder and then QTP is invoked and initiated to save
results in the predetermined location.
qtResultsOpt.ResultsLocation = QTPResultspath
App.Test.Run qtResultsOpt
App.Test.Run
___________________CODE________________
MasterFolder = C:TestAutomation
Dim App, qtResultsOpt, fso, f
Set App = CreateObject(QuickTest.Application)
If App.Launched = False Then
App.Launch
End If
App.Visible = True
App.Options.Run.ImageCaptureForTestResults = Always
App.Options.Run.RunMode = Fast
App.Options.Run.ViewResults = True
App.Open MasterFolder&TestsEFiles,False,False
App.Test.Seings.Resources.Libraries.RemoveAll
App.Test.Seings.Resources.Libraries.Add MasterFolder&Business FunctionsTestScripts.vbs
__________________ START of creating a result folder _________________
Temp = Now
Temp1 = Replace (Temp, /,-)
Temp2 = Replace(Temp1, AM,)
Temp3 = Replace(Temp2, PM,)
Temp4 = Replace(Temp3,:,)
FolderName = Replace(Temp4, ,_)
QTPResultspath = C:TestAutomationQTPResults&FolderName
QTPResultspath = MasterFolder&QTPResults&FolderName
Set fso = CreateObject(Scripting.FileSystemObject)
If Not fso.FolderExists(QTPResultspath) Then
Set f = fso.CreateFolder(QTPResultspath)
End If
Set f = nothing
Set fso = nothing
__________________ END of creating a result folder _________________
Set qtResultsOpt = CreateObject(QuickTest.RunResultsOptions)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
72 of 165 8/12/2014 6:10 PM
qtResultsOpt.ResultsLocation = QTPResultspath
App.Test.Run qtResultsOpt
App.Test.Run
Set App = nothing
Set qtResultsOpt = Nothing
Working with Excel using VB Script Code Snippets
31 MAY 2012 Leave a comment
by vsprasad2k in QTP, QTP ADODB, QTP Excel, QTP VBScript
Add Data to a Spreadsheet Cell
Demonstration script that adds the words Test Value to cell 1,1 in a new spreadsheet.
Set objExcel = CreateObject(Excel.Application)
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = Test value
Add Formatted Data to a Spreadsheet
Demonstration script that adds the words test value to a new spreadsheet, then formats the cell
containing the value.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Test value"
objExcel.Cells(1, 1).Font.Bold = TRUE
objExcel.Cells(1, 1).Font.Size = 24
objExcel.Cells(1, 1).Font.ColorIndex = 3
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
73 of 165 8/12/2014 6:10 PM
Create User Accounts Based on Information in a Spreadsheet
Demonstration script that creates new Active Directory user accounts based on information stored in an
Excel spreadsheet.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:ScriptsNew_users.xls")
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = ""
Set objOU = GetObject("ou=Finance, dc=fabrikam, dc=com")
Set objUser = objOU.Create _
("User", "cn=" & objExcel.Cells(intRow, 1).Value)
objUser.sAMAccountName = objExcel.Cells(intRow, 2).Value
objUser.GivenName = objExcel.Cells(intRow, 3).Value
objUser.SN = objExcel.Cells(intRow, 4).Value
objUser.AccountDisabled = FALSE
objUser.SetInfo
intRow = intRow + 1
Loop
objExcel.Quit
Format a Range of Cells
Demonstration script that adds data to four dierent cells in a spreadsheet, then uses the Range object to
format multiple cells at the same time.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
74 of 165 8/12/2014 6:10 PM
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Name"
objExcel.Cells(1, 1).Font.Bold = TRUE
objExcel.Cells(1, 1).Interior.ColorIndex = 30
objExcel.Cells(1, 1).Font.ColorIndex = 2
objExcel.Cells(2, 1).Value = "Test value 1"
objExcel.Cells(3, 1).Value = "Test value 2"
objExcel.Cells(4, 1).Value = "Tets value 3"
objExcel.Cells(5, 1).Value = "Test value 4"
Set objRange = objExcel.Range("A1","A5")
objRange.Font.Size = 14
Set objRange = objExcel.Range("A2","A5")
objRange.Interior.ColorIndex = 36
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.AutoFit()
List Active Directory Data in a Spreadsheet
Demonstration script that retrieves data from Active Directory and then displays that data in an Excel
spreadsheet.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
75 of 165 8/12/2014 6:10 PM
Const ADS_SCOPE_SUBTREE = 2
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Last name"
objExcel.Cells(1, 2).Value = "First name"
objExcel.Cells(1, 3).Value = "Department"
objExcel.Cells(1, 4).Value = "Phone number"
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 100
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT givenName, SN, department, telephoneNumber FROM " _
& "'LDAP://dc=fabrikam,dc=microsoft,dc=com' WHERE " _
& "objectCategory='user'"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
x = 2
Do Until objRecordSet.EOF
objExcel.Cells(x, 1).Value = _
objRecordSet.Fields("SN").Value
objExcel.Cells(x, 2).Value = _
objRecordSet.Fields("givenName").Value
objExcel.Cells(x, 3).Value = _
objRecordSet.Fields("department").Value
objExcel.Cells(x, 4).Value = _
objRecordSet.Fields("telephoneNumber").Value
x = x + 1
objRecordSet.MoveNext
Loop
Set objRange = objExcel.Range("A1")
objRange.Activate
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("B1")
objRange.Activate
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
76 of 165 8/12/2014 6:10 PM
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("C1")
objRange.Activate
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("D1")
objRange.Activate
Set objRange = objExcel.ActiveCell.EntireColumn
objRange.Autofit()
Set objRange = objExcel.Range("A1").SpecialCells(11)
Set objRange2 = objExcel.Range("C1")
Set objRange3 = objExcel.Range("A1")
List Excel Color Values
Demonstration script that displays the various colors and their related color index available when
programmatically controlling Microsoft Excel.
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
For i = 1 to 56
objExcel.Cells(i, 1).Value = i
objExcel.Cells(i, 1).Interior.ColorIndex = i
Next
List Service Data in a Spreadsheet
Demonstration script that retrieves information about each service running on a computer, and then
displays that data in an Excel spreadsheet.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
77 of 165 8/12/2014 6:10 PM
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.Workbooks.Add
x = 1
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:\" & strComputer & "rootcimv2")
Set colServices = objWMIService.ExecQuery _
("Select * From Win32_Service")
For Each objService in colServices
objExcel.Cells(x, 1) = objService.Name
objExcel.Cells(x, 2) = objService.State
x = x + 1
Next
Open an Excel Spreadsheet
Demonstration script that opens an existing Excel spreadsheet named C:ScriptsNew_users.xls.
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:ScriptsNew_users.xls")
Read an Excel Spreadsheet
Demonstration script that reads the values stored in a spreadsheet named C:ScriptsNew_users.xls.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
78 of 165 8/12/2014 6:10 PM
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open _
("C:ScriptsNew_users.xls")
intRow = 2
Do Until objExcel.Cells(intRow,1).Value = ""
Wscript.Echo "CN: " & objExcel.Cells(intRow, 1).Value
Wscript.Echo "sAMAccountName: " & objExcel.Cells(intRow, 2).Value
Wscript.Echo "GivenName: " & objExcel.Cells(intRow, 3).Value
Wscript.Echo "LastName: " & objExcel.Cells(intRow, 4).Value
intRow = intRow + 1
Loop
objExcel.Quit
Reference:
http://www.activexperts.com/activmonitor/windowsmanagement/scripts/msoffice/excel/ (http://www.activexp
Excel Get Used Range Count and Insert Picture using
VB Scripting
31 MAY 2012 Leave a comment
by vsprasad2k in QTP, QTP Excel, Uncategorized
Set objXL = CreateObject(Excel.Application)
objXL.visible = True
objXL.DisplayAlerts = false
Set wkb = objXL.Workbooks.Open(ExcelFilePath)
Set ws = wkb.Sheets(Sample)
Used_RowCount = ws.UsedRange.Rows.Count
Used_ColumnCount = ws.UsedRange.Rows.Count
Next_Row_Range = Used_RowCount +3
Add_Column_Range = Used_ColumnCount + 10
Cell_Range = A & Next_Row_Range &:G & Add_Column_Range
Set objRng = ws.Range(Cell_Range)
Insert Picture..
objRng.Merge
Set Picture = ws.Pictures.Insert(ImageFilePath)
With Picture
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
79 of 165 8/12/2014 6:10 PM
.Top = objRng.Top
.Left = objRng.Left
.Width = objRng.Width
.Height = objRng.Height
End With
Insert text
ws.Cells(Cell_Range).Value = Test value
wkb.SaveAs ExcelFilePath
wkb.Close
objXL.Quit
********************************************************
Function FindLastCell()
Dim lRow As Long, lCol As Integer, mRow As Long, mCol As Integer
lCol = ActiveSheet.UsedRange.Columns.Count
mRow = 0
For i = 1 To lCol
lRow = Range(Cells(rows.count, i), Cells(rows.count, i)).End(xlUp).Row
If lRow > mRow Then
mRow = lRow
mCol = i
Else
End If
Next i
FindLastCell = Range(Cells(mRow, mCol), Cells(mRow, mCol)).Address
End Function
BPT running in an infinite loop hen using QTP 11 QC11
15 APR 2012 Leave a comment
by vsprasad2k in challenges, QTP, QTP Patch, QTP Tricks Tags: bpt, QTP 11.0 Patch
BPTs running in an innite loop? Going crazy trying to gure out the solution for it?
Its Patch QTP_00821
HP has just released a critical patch for people using QuickTest Professional 11 and ALM/QC 11.00 with
BPT. The patch resolves an issue with seings that were setup for normal QTP test were sometimes
incorrectly applied to a Business Process Test run. These seing caused the BPT to run in an innite
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
80 of 165 8/12/2014 6:10 PM
loop.
Patch QTP_00821 (hp://support.openview.hp.com/selfsolve/document
/FID/DOCUMENTUM_QTP_00821) can be downloaded from HP.

Web Automation Testing Tools
07 APR 2012 Leave a comment
by vsprasad2k in challenges, COM DCOM AOM, QTP Tricks, QTP VBScript Tags: Automation Testing
Tools
Web Testing Tools
RedBot (hp://mnot.github.com/redbot/)- An open source robot that checks HTTP resources to see how
theyll behave, pointing out common problems and suggesting improvements. Although it is not a
HTTP conformance tester, it can nd a number of HTTP-related issues. Interacts with the resource at the
provided URL to check for a large number of common HTTP problems, including: Invalid syntax in
headers, ill-formed messages (e.g., bad chunking, incorrect content-length), incorrect gzip encoding,
missing headers. Additionally, it will tell how well your resource supports such HTTP features as
caching, negotiation for compression, last-Modied and ETag validation, partial content. Supports hp
but not hps.
Webpagetest (hp://www.webpagetest.org/)- A tool that was orginially developed by AOL for use
internally and was open-sourced in 2008. The online version atwww.webpagetest.org
(hp://www.webpagetest.org/) is an industry collaboration with various companies providing the
testing infrastructure for testing your site from across the globe. Provides web page content analysis,
performance analysis, various performance scores. APIs availabel for scripting.
Page Speed (hp://code.google.com/speed/page-speed/)- An open-source project started at Google to
help developers optimize their web pages by applying web performance best practices. Started as an
open-source Firefox/Firebug add-on and is now deployed in third-party products such as
Webpagetest.org, Show Slow and Google Webmaster Tools. Page Speed family of tools includes Page
Speed Firefox/Firebug add-on which allows you to evaluate the performance of web pages and to get
suggestions on how to improve them, and the mod_pagespeed Apache module which automatically
rewrites pages and resources to improve their performance.
Speed Tracer (hp://code.google.com/webtoolkit/speedtracer/)- An open source tool to help you
identify and x performance problems in your web applications. It visualizes metrics that are taken
from low level instrumentation points inside of the browser and analyzes them as your application runs.
Speed Tracer is available as a Chrome extension and works on all platforms where extensions are
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
81 of 165 8/12/2014 6:10 PM
currently supported (Windows and Linux). Using Speed Tracer you are able to get a beer picture of
where time is being spent in your application. This includes problems caused by JavaScript parsing and
execution, layout, CSS style recalculation and selector matching, DOM event handling, network resource
loading, timer res, XMLHpRequest callbacks, painting, and more.
ShowSlow (hp://www.showslow.org/)- An open source tool that helps monitor various website
performance metrics over time by collecting web performance data and showing it in aggregated form
for beer business understanding. Captures the results of YSlow and Page Speed rankings and graphs
them, to help you understand how various changes to your site aect its performance.
Blaze (hp://www.blaze.io/)- An online service from From Blaze Software Inc. for optimizing website
speed by optimizing Front End Performance. Blazes automated optimization combined with its
Content Delivery Network partner can maximize the potential performance of your web site.
Fitnium (hp://www.magneticreason.com/tools/tnium/tnium.html)- Fitnium from
Magneticreason.com provides the ability to write and execute Selenium tests using the
FitNesse (hp://tnesse.org/)framework but without the need to write code. Based on a FitNesse
DoFixture, provides an English language interpretation of the Selenium API that you would normally
call from Java, Ruby, Python, Perl or C#. In this instance it allows developers, testers, and customers to
write UI driven automated acceptance tests. All APIs available to Java, Ruby, Python, Perl or C#
developers is now available as an easily understand English phrase that anyone can use to develop their
own tests.
Sauce OnDemand (hp://saucelabs.com/)- Runs Selenium tests in parallel across multiple browsers in
the cloud; from SauceLabs Inc. Acts as a drop-in replacement for Selenium RC, allowing simple
conguring of scripts to use Sauce OnDemand. Unlimited browser instances enables testing as many
apps across as many browsers as needed; live remote control views of tests running in Sauce
OnDemand enables faster test debugging cycles; run FireFox Custom Proles in the Cloud; test apps
securely behind a rewall with Sauce Tunnel connects a VM on your internal webserver to Sauce
OnDemand via SSH, with only the Sauce Labs machines actively running the tests having access and
when a test is nished, access is revoked.
JSView (hps://addons.mozilla.org/en-US/refox/addon/2076?collection_uuid=6fa2752d-f181-3d1d-
bccf-508f57c939)- Firefox plugin enables ability to view the source code of external les. Most websites
store their javascripts and style sheets in external les and then link to them within a web pages source
code. JSView enables access to these les from the context menu, from the toolbar, from the view menu,
or from the status bar. If the website you are viewing contains any external js/css les, an icon will
appear that says SS, JS, or both. Each individual le can then be viewed by clicking on the lename.
The le will be opened in a new window. You can also choose to open all external les by clicking on
View All.
Flash-Selenium (hp://code.google.com/p/ash-selenium/)- The Flash-selenium open source project
extends the Selenium RC clients for adding Flash communication capabilities. Enables direct testing of
the UI components of a Flex application.
Selenium-Flex API (hp://code.google.com/p/sfapi/)- The Selenium-Flex API allows automation of Flex
applications using the popular test automation tool Selenium. The API is easy to set up and can be done
with only basic working knowledge of either Flex or Selenium. Requires Firefox and inclusion of the
Selenium-Flex API in Flex app build.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
82 of 165 8/12/2014 6:10 PM
Virtu-El.com Spell Checker (hp://virtu-el.com/) Online free spell checker and link checker from C#
computing.
HTTPDebugger (hp://www.hpdebugger.com/)- HTTP Trac Analyzer tool from MadeForNet.com
that enable eective debugging of hp headers and hp content. Analyze HTTP headers, POST data,
cookies, error codes and SOAP envelopes; measure the size, execution and downloading time of
dynamic web pages; view the trac from browser add-ons, ActiveX components and Java applets;
decode HTTPS connections and gzip/chunked encodings; see complete stats in charts and diagrams.
Supports a variety of browsers.
WebWait (hp://webwait.com/)- Free online web site timer from Michael Mahemof; use to benchmark
your website or test the speed of your web connection; pulls down the entire website into your browser,
so it takes into account Ajax/Javascript processing and image loading which other tools ignore.
Cucumber (hp://cukes.info/)- Cucumber is a tool that can execute plain-text functional descriptions as
automated tests. The language that Cucumber understands is called Gherkin. While Cucumber can be
thought of as a testing tool, the intent of the tool is to support BDD (Behavior-Driven Development).
This means that the tests (plain text feature descriptions with scenarios) are typically wrien before
anything else and veried by business analysts, domain experts, etc. non technical stakeholders. The
production code is then wrien outside-in, to make the stories pass. Cucumber itself is wrien in Ruby,
but it can be used to test code wrien in Ruby or other languages including but not limited to Java, C#
and Python. Requires only minimal use of Ruby scripting, so cucumber can be utilized in testing
contexts where the application code is not Ruby.
Aptimize Website Accelerator (hp://www.aptimize.com/)- An ISAPI lter for Microsoft IIS, or a
Daemon and module for Linux Apache, that automates performance tuning by dynamically optimizing
web pages for high performance at runtime just before a page is sent from web server to browser. For
Win and Linux platforms.
Spello (hp://spello.codeplex.com/)- Open source web site spell checker; run as a windows form or
command line. Supports English (US and UK), French, German and Spanish (Spain and Mexico)
dictionaries. More dictionaries can be downloaded from hp://wiki.services.openoce.org
/wiki/Dictionaries (hp://wiki.services.openoce.org/wiki/Dictionaries). Html based log le. Wrien in
C#, requires Microsoft.Net 3.5 SP1, the setup program has a bootstrapper to install it.
eggPlant (hp://www.testplant.com/)- An image-based, low-overhead, non-invasive black-box test
automation tool. Does not reside on the system-under-test and is technology agnostic, so it can test in
many situations that other tools cannot by using image capture and advanced search techniques. Does
not interact with the underlying code, and can test any application including those that can cause
problems for other tools such as Flash, Silverlight, etc. Works
T-Plan Robot (hp://www.t-plan.com/robot/)- A black box automated testing tool developed on generic
image based testing principles; provides a human-like approach to software testing and performs in
situations where other tools may fail. Support of Java test scripts as well as a proprietary scripting
language; record & replay capability; support of testing over the RFB protocol (beer known as VNC);
ability to perform black box GUI testing of mobile phones (Windows Mobile, Symbian, iPhone); open
architecture with a generic plugin interface and well documented programming interfaces. Platform
independent (Java); runs on, and automates major systems, such as Windows, Linux, Unix, Solaris and
certain mobile platforms.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
83 of 165 8/12/2014 6:10 PM
Browsershots (hp://browsershots.org/)- Free online cross browser/OS comparison testing. Choose
browser OS, browser, and versions of interest and submit URL and site responds with a collection of
screen shots.
Multi-Browser Viewer (hp://www.multibrowserviewer.com/faq.asp)- Cross browser testing solution
from TWD Solutions Pte Ltd. includes a wide variety of standalone virtualized browsers, multiple
standalone mobile browsers or simulators, 58 screen capture image browsers; Screenshot comparison
function (Onion Skin or Side-by-Side); available in multiple languages.
IE collection at Final Builds site (hp://nalbuilds.edskes.net/iecollection.htm) Enables installing
standalone IE browser versions for comparison/testing, MS IE versions 1.0 thru 8.0.
BrowserSeal (hp://browserseal.com/)- Multi browser website screenshot tool capture an image of
web site under multiple browsers Supports multiple versions of IE, Firefox, Google Chrome, Opera,
Safari. Optimized for speed. Comes with standalone versions of all major browsers to verify site layout
issues and troubleshoot functionality issues. The Automated edition adds the ability to automaitcally
capture miltuple URLs without user intervention, and command-line control enabling use in automation
scripts. For Windows platforms.
LiteTest (hp://www.litetest.com/)- Web analysis and evaluation reports of your website usability and
other aspects; you test other users websites, and they test yours. Complete a website evaluation report
for three other sites and you will then be guaranteed a minimum of three web analysis reports on your
own site. Registration and evaluations are free.
System Shephard (hp://www.absolute-performance.com/)- An IT Performance Monitoring and
Operations Management Platform for web and other systems; from Absolute Performance Inc. Modules
include StressWalk and WebWalk. Delivers an enterprise-wide view of system performance and alert
status; supplies analysis and reports based on real-time, recent, and historical data
Spydermate (hp://spydermate.com/)- Free online SEO analysis tool from MentorMate that gives a
numerical and visual representation of a websites online marketing eort by using a variety of graphs
and statistics. Other capabilities: page-specic on-site keyword analysis; side-by-side comparisons of
your own website against a competitor.
Twill (hp://twill.idyll.org/)- Simple open source Python-based scripting language for web browser
control from a command-line interface. Navigate through Web sites that use forms, cookies, and most
standard Web features. Supports automated Web testing
Firefox Web Testing Add-ons (hps://addons.mozilla.org/en-US/refox/search?q=test&cat=1%2C4&
as=true&vfuz=true&appid=1&lver=1.0&hver=any&atype=0&pid=0&lup=&pp=20&
sort=weeklydownloads)- Includes many tools that can be useful for testing such as iMacros for Firefox,
WASP, Fireshot, Window Resizer, Selenium IDE, Web Developer, SwitchProxy, IE Tab, Molybdenum,
HackBar, and many more.
Web Testing Plugin collection (hp://agilewebdevelopment.com/plugins/category/3)- Large collection of
links to and short descriptions of open source utilities and tools for web testing, unit testing, assertions,
mocks, xture utilities, reporting, validators, code coverage, etc. Mostly for Ruby, maintained by
Benjamin Curtis
UTE (hp://www.mindd.com/)- Automated usability testing environment from Mind Design Systems,
Inc. Assists in quantitative usability evaluation of websites and web applications; automates capture of
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
84 of 165 8/12/2014 6:10 PM
usability data in detail not easily done by a human observer. Consists of a) a UTE Manager which helps
set up test scenarios (tasks) as well as survey and demographic questions, and compiles results and
produces customized reports and summary data; and b) a UTE Runner which presents test participants
with test scenarios (tasks) as well as any demographic and survey questions; the runner also tracks
actions of the subject throughout the test including clicks, keystrokes, and scrolling.
Venkman Javascript Debugger (hps://addons.mozilla.org/en-US/refox/addon/216)- Firefox extension;
open source JavaScript debugging environment for Mozilla based browsers.
XPather (hp://xpath.alephzarro.com/)Firefox add-on by Viktor Zigo. Has rich XPath generator, editor,
inspector and simple extraction tool. Requires the standard DOM inspector plugin for FF3.
FlexMonkey (hp://code.google.com/p/exmonkey/)- A testing framework for Flex apps. Capabilities
include capture, replay and verication of Flex UI functionality. Can generate ActionScript-based testing
scripts that can easily be included within a continuous integration process. Uses the Flex Automation
API and was created by extending Adobes sample automation adapter, AutoQuick. Donated to the Flex
community by Gorilla Logic. Site also lists info and links to three other open source Flex test
tools/frameworks: FlexUnit, Selenium-Flex, and FunFx.
UnmaskParasites (hp://unmaskparasites.com/)- A free online service that checks web pages for hidden
illicit content (invisible spam links, iframes, malicious scripts and redirects). By Denis Sinegubko. Just
type in the URL of the web site to be checked.
TestArmy (hp://www.testarmy.com/)- TestArmy provides cheap access to a large, exible base of
testers with a wide range of hardware. Test applications thoroughly in a variety of environments, at
lower cost, using crowd-sourcing. Enable more ecient testing on the end user hardware and software
platforms that have proliferated, particularly for mobile and web applications. Developed by Peter
Georgeson.
Rasta (hp://rasta.rubyforge.org/)- Rasta is a keyword-driven open source test framework by Hugh
McGowan using spreadsheets to drive testing. Loosely based on FIT, where data tables dene
parameters and expected results. The spreadsheet can then be parsed using your test xtures. For the
underlying test harness, Rasta uses RSpec so in addition to reporting results back to the spreadsheet you
can take advantage of RSpecs output formaers and simultaneously export into other formats such as
HTML and plain text. Since Rasta utilizes Ruby, it can work well with Watir (listed elsewhere in this
page).
File Comparators (hp://www.foldermatch.com/fmcompetitors.htm)- Web testing or any type of
testing often involves verication of data vs expected data. While this is simple enough
programmatically for single data points or small data sets, comparison of large amounts of data can be
more challenging. This site, maintained by FolderMatch/Salty Brine Software, a windows le/folder
comparator tool vendor, lists a large number of Win data comparators. An old (2003) but still useful
listing of mostly non-Windows data comparator tools is maintained by Danny Faught in his Open
Testware Reviews sites Data Comparator Survey (hp://tejasconsulting.com/open-testware/feature
/data-comparator-survey.html).
TMX (hp://www.critical-logic.com/)- Keyword driven test automation product from Critical Logic,
provides automated, fully annotated, executable scripts for QTPro, Watir, TestPartner, and SilkTest.
Imports the objects that make up an application (radio buons, entry elds, etc.) and builds an Object
Tree containing all elements and aributes subject to testing. Then automatically generates the
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
85 of 165 8/12/2014 6:10 PM
executable test scripts and test documentation. Virtual Objects allow building of test scripts from
requirements in parallel with code development.
Googles Website Optimizer (hp://www.google.com/websiteoptimizer)- Googles service for testing
variations in site design (titles, images, content, etc) to determine impacts on conversions, user actions,
trac, or other goals.
YSlow (hp://developer.yahoo.com/yslow/)- Free open source tool analyzes web pages and explains
why theyre slow based on rules for high performance web sites. A Firefox add-on integrated with the
Firebug web development tool. Includes a Performance report card, HTTP/HTML summary, list of
components in page and related info, tools including JSLint. Generates a grade for each rule and an
overall grade, lists suggested specic changes to improve performance, calculates total size of page for
empty and primed cache scenarios, cookie info. Can also view HTTP response headers for any
component.
ItsNat (hp://itsnat.sourceforge.net/)- Open source Java AJAX component-based web development
framework provides a natural approach to web development; leverages old tools to build new AJAX
based Web 2.0 applications. Server centric using an approach called TBITS, The Browser Is The Server:
simulates a Universal W3C Java Browser at the server mimicing the behavior of a web browser,
containing a W3C DOM Level 2 node tree and receiving W3C DOM Events. Contains signicant built in
functional web test support.
HTT (hp://sourceforge.net/projects/h)- Open source scriptable HTTP test tool for testing and
benchmarking web apps and for HTTP server development. Can act as client (requesting) and server
(backend for reverse proxys). Paern matching answers (both server and client) to test validity. Supports
chunking in request and response.
Web Page Analyzer (hp://www.websiteoptimization.com/)- Free online website performance tool and
page speed analysis from Website Optimization. Calculate page size, composition, and download time.,
size of individual elements and sums up each type of web page component. Then oers advice on
improving page load time.
HTTPWatch (hp://hpwatch.com/)- An HTTP viewer and debugger plugin for MS Internet Explorer
for HTTP and HTTPS monitoring without leaving browser window. Real-time page and request level
time charts;millisecond accurate timings and network level data. Includes automation interface that can
be used by most programming languages. Supports ltering of requests by criteria such as content
types, response codes, URLs, headers and content. Basic free and paid versions available.
IBM Rational Policy Tester Accessibility Edition (hp://www-306.ibm.com/software/awdtools/tester
/policy/accessibility/)- Helps ensure Web site accessibility to all users by monitoring for over 170
comprehensive accessibility checks. It helps determine the sites level of compliance with government
standards, including the U.S. governments Section 508 and guidelines such as the World Wide Web
Consortiums Web Content Accessibility Guidelines (W3C WCAG), the UKs Disability Discrimination
Act, and Frances AccessiWeb.
IBM Rational Policy Tester Privacy Edition (hp://www-306.ibm.com/software/awdtools/tester/policy
/privacy/)- Reports on form, form controls, and Form GET inventory, pages collecting Personally
Identiable Information (PII) and privacy policy links. Generates inventory of site privacy policies and
checks and checks for secure pages and encryption and third-party data sharing policies; maps technical
checks to specic online requirements of laws and regulations, such as U.S. Childrens Online Privacy
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
86 of 165 8/12/2014 6:10 PM
Protection Act (COPPA), Gramm-Leach-Bliley Act (GLBA) Privacy Rules, HIPAA, California SB1386 &
AB1950 and AB1 950; Safe Harbor re European Communitys Directive on Data Protection; and U.S.
Section 208.
TextTrust (hp://www.texrust.com/)- Online service for one time or periodic full site spell checking;
report includes listing of each text error with URL, built-in spelling mistake highlighter; correct your
errors with Google suggestion lookup. System learns as it checks, detects industry terms and buzzwords
such that only real errors are reported.
WireShark (hp://www.wireshark.org/)- Network protocol analyzer available under the GNU General
Public License. Capabilities include deep inspection of hundreds of protocols, live capture and oine
analysis, standard three-pane packet browser, runs on most platforms. Captured network data can be
browsed via a GUI, or via the TTY-mode TShark utility; rich VoIP analysis; read/write a very wide
variety of dierent capture le formats. Live data can be read from Ethernet, IEEE 802.11, PPP/HDLC,
ATM, Bluetooth, USB, Token Ring, Frame Relay, FDDI, and others. Decryption support for many
protocols, including IPsec, ISAKMP, Kerberos, SNMPv3, SSL/TLS, WEP, and WPA/WPA2. Coloring
rules can be applied to the packet list for quick, intuitive analysis. Output can be exported to XML,
PostScript, CSV, or plain text
TPTest (hp://sourceforge.net/projects/tptest)- An open source software suite for testing network
throughput and Internet services. It consists of a software library with test functions that can be
implemented in test client and server applications. Reference client/server apps are also included.
BWMeter (hp://www.desksoft.com/BWMeter.htm) Bandwidth meter, monitor and trac controller,
which measures, displays and controls all trac to/from computer(s) or on your network. Can analyze
the data packets (where they come from, where they go, which port and protocol they use). For
Windows platforms. Shareware.
Fiddler (hp://www.ddlertool.com/ddler/) HTTP Debugging Proxy which logs all HTTP trac
between your computer and the Internet. Fiddler allows you to inspect all HTTP Trac, set breakpoints,
and ddle with incoming or outgoing data. Fiddler includes a powerful event-based scripting
subsystem, and can be extended using any .NET language. Can debug trac from virtually any
application. For Windows platforms. Freeware.
HTTP Interceptor (hp://www.siliconwold.com/interceptor/interceptor_home.htm)- Low cost pseudo
Proxy server that performs hp diagnostics and enables viewing of the two way communication
between browser and the Internet. View hp, asp, hp header, data headers, responses. Demo version
Free and paid versions available.
Expecco (hp://www.expecco.net/)- A component based, modular test and quality assurance platform
from eXept Software AG, which aims at the consolidation of tests and partial test systems into an
automated, interactive test center. Enables productivity improvement in creation and maintenance of
test scenarios, includes extensive debug features and exible integration into existing enterprises.
Features include utilization of UML 2.0 and Selenium libraries.
Aptixia IxLoad (hp://www.ixiacom.com/)- Highly scalable, integrated test solution from Ixia Inc. for
assessing the performance of Triple Play (Voice, Video and Data services) networks and devices. IxLoad
emulates IPTV and Triple Play subscribers and associated protocols to ensure subscriber Quality of
Experience (QoE). Protocols supported include video protocols like IGMP, MLD, and RTSP; voice
protocols like SIP and MGCP; and data protocols like HTTP, FTP, and SMTP. Can be used to test critical
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
87 of 165 8/12/2014 6:10 PM
aspects of the infrastructure like DNS, DHCP, RADIUS, and LDAP services, as well generate malicious
trac to test for security. Also available are a wide variety of other related performance test tools to help
accelerate the migration of communications and entertainment to IP.
Internet Explorer Developer Toolbar (hp://www.microsoft.com/downloads
/details.aspx?FamilyID=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en)- Microsoft add-on for
IE that includes some tools for that can be useful for web testing. Includes tools to explore a pages
document object model (DOM), locate and select specic elements on a Web page through a variety of
techniques, view HTML object class names, IDs, and details such as link paths, tab index values, and
access keys; validate HTML, CSS, WAI, and RSS web feed links; view the formaed and syntax colored
source of HTML and CSS; and more.
Web Service Scheduler (hp://www.wsscheduler.com/)- WSS is an online cron service that can execute
custom scripts remotely, for websites hosted on a web server with no access to a scheduling utility like
cron or task scheduler. To use, just login and add the URL of the web service or script (PHP, ASP, CGI)
and the time you would like the service to run. Basic account is free.
Chickenfoot (hp://groups.csail.mit.edu/uid/chickenfoot/index.php)- An open source Firefox extension
from MIT that creates a programming environment in the Firefox sidebar, enables wrting of scripts to
manipulate web pages and automate web browsing. Scripts are wrien in a superset of Javascript that
includes special functions specic to web tasks.
WebAii (hp://www.telerik.com/automated-testing-tools.aspx)- Free web automation framework from
Telerik that helps developers easily write functional tests for AJAX and Silverlight applications. The
framework oers one consistent API that allows users to automate the UI of web applications as part of
regression testing. Besides Silverlight support, a key benet of WebAii Testing Framework is the
browser abstraction, which allows developers to create a test once and execute it against all major
browsers IE, FF, and Safari for Windows are currently supported.
sketchPath (hp://www.sketchpath.com/)- Free XPath Editor and XML analysis and testing tool by Phil
Fearon supporting XPath 1.0 and 2.0. Capabilities includes: Provides integrated graphical environment
for viewing XML les, developing and testing XPath expressions against them and managing the
expressions in le libraries. Auto-Generate XPath locations by selecting from XPath result list, regular
expression result list, element tree view, element nodes list, XML text editor, etc. Import XPath
Expressions from an XML source (eg. XSLT). auto-complete uses Look-Ahead to list available location
and value nodes when typing, XSD schema validation with fully-navigable invalid elements list. Use
regular expressions to resolve XPath locations. And more. For Windows platforms.
soapUI (hp://www.soapui.org/)- A free, open source desktop application from Eviware Software AB
for inspecting, invoking, developing, simulating/mocking and functional/load/compliance testing of
web services over HTTP. It is mainly aimed at developers/testers providing and/or consuming web
services (java, .net, etc). Functional and Load-Testing can be done both interactively in soapUI or within
an automated build/integration process using the soapUI command-line tools. Mock Web Services can
be created for any WSDL and hosted from within soapUI or using the command-line MockService
runner. IDE-plugins available for eclipse, IntelliJ IDEA, NetBeans and a specialized eclipse-plugin for
JBossWS. Paid pro version available with professional support and extended functionality.
SOAPscope Server (hp://www.mindreef.com/products/coral/)- Web services test tool from Mindreef
Inc./Progress Software; create test scenarios automatically by recording actions; share these with other
testers in collaborative server-baaed UI. View WSDL and SOAP messages in Pseudocode ViewTM.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
88 of 165 8/12/2014 6:10 PM
Create complex tests including passing values from a response to subsequent requests, perform batch
testing and validate results all without coding. Simulate web services that dont yet exist, or new
scenarios for those that do.
Parasoft SOAtest (hp://www.parasoft.com/)- Scriptless web services test tool from Parasoft. Automatic
test creation from WSDL, WSIL, UDDI and HTTP Trac. Capabilities include WSDL validation, load
and performance testing; graphically model and test complex scenarios. Automatically creates security
penetration tests for SQL injections, XPath injections, parameter fuzzing, XML bombs, and external
entities. Data-driven testing through data sources such as Excel, CSV, DB queries, etc. Support for JMS;
MIME aachment support.
QEngine (hp://www.manageengine.com/)- ManageEngine QEngine Web Service Functional Test tool
automates functional testing of web services that are bound with the SOAP/HTTP binding.
Automatically generates test scripts from a WSDL document and validates every operation published in
the WSDL document. The responses to each SOAP/HTTP request can be validated against the data
sources such as CSV or Database.
Fault Factory (hp://extradata.com/products/FaultFactory/)- API-level fault injection tool from from
Extradata Technologies; injects HTTP/SOAP/Socket faults into an application no code changes, no
proxies required. Injects two types of faults: socket API failures and arbitrary HTTP responses (that can
be used to imitate a wide range of conditions, including SOAP faults). Can be used standalone or in
combination with a debugger. Language-neutral. For Windows platforms.
XML-Simulator (hp://www.xml-simulator.com/)- Black-box test tool from Elvior for applications using
asynchronous XML messaging to communicate with dierent systems. Customizable to support any
XML protocol.
Tools4Internet (hp://www.tools4internet.com/)- Free on-the-web tools for determination/testing of
various web page/site characteristics; results presented in convenient tabbed summary format. Includes
browser/server security information tool for viewing details of hp headers sent from web server and
browser, along with other information obtainable via javascript and other publicly available means. Web
Content Analysis capability includes response time, web page code comments lines, anchors, scripts, etc.
Firebug (hp://www.getrebug.com/)- Open source add-on tool for Firefox allows editing,
debugging, and monitoring of CSS, HTML, and JavaScript live in any web page. Monitor network
activity, visualize CSS metrics, information about errors in JavaScript, CSS, and XML. Includes DOM
explorer; execute JavaScript on the y.
GH Tester (hp://www.greenhatsoftware.com/)- Middleware test automation tool, from Green Hat
Consulting Limited, for testing systems that do not have graphical user interfaces including web
services, JMS, IBM MQ, Sonic MQ, TIBCO, TCP/IP, UDP/IP and SmartSockets. Includes an API enabling
writing of your own transports. Schema-aware message editors for XML (DTD and XSD), SOAP (WSDL)
and AE. Other capabilities: automatically create test plan documentation, record and playback
messages, integrate with databases to simulate adapters by querying or changing rows, produce
detailed reports on actual test results and expectations, including any dierences
Filemon (hp://www.microsoft.com/technet/sysinternals/utilities/lemon.mspx)- Free tool from
Microsoft monitors and displays Windows le system activity on a system in real-time. Timestamping
feature shows when every open, read, write or delete, happens, and its status column indicates outcome.
Useful in security testing, monitoring/testing of web servers etc. Also available (links available on
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
89 of 165 8/12/2014 6:10 PM
Filemon page): RegMon a Registry monitor; Process Monitor a process and thread monitor; DiskMon
a hard disk monitor.
AceLive (hp://www.opnet.com/)- Tool from OpNet Technologies Inc. for end-user experience
monitoring and application performance management. Spans network monitoring, measurement, and
detection of SLA violations, and can bridges seamlessly into integrated and detailed transaction-level
troubleshooting with OPNETs ACE Analyst.
Charles (hp://www.xk72.com/)- An HTTP proxy/monitor/Reverse Proxy that enables viewing all
HTTP trac between browser and the Internet, including requests, responses and HTTP headers (which
contain the cookies and caching information). Capabilities include HTTP/SSL and variable modem
speed simulation. Useful for XML development in web browsers, such as AJAX (Asynchronous
Javascript and XML) and XMLHTTP, as it enables viewing of actual XML between the client and the
server. Can autocongure browsers proxy seings on MSIE, Firefox, Safari. Java application from XK72
Ltd.
Paessler Site Inspector (hp://www.paessler.com/)- A web browser that combines MSIE and
Mozilla/Gecko into one program; its Analyzing Browser allows switching between the two browser
engines with the click of a mouse to compare. Freeware.
CookiePie Firefox Extension (hp://nektra.com/oss/refox/extensions/cookiepie/)- Firefox extension
from Sebastian Wain enabling maintenance of dierent cookies in dierent tabs and windows. For
example developers working on web software supporting multiple users or proles can use CookiePie
to simultaneusly test their software with each user without needing to open a dierent browser.
Broken Link Preventer (hp://www.siliconglen.com/software/links.html)- Link checker that reports on
broken links, reports statistics on user aempts to access broken links, and enables broken link
prevention. Runs on server and constantly monitors site links.
JsUnit (hp://www.jsunit.net/)- An open-source unit testing framework for client-side (in-browser)
JavaScript in the tradition of the XUnit frameworks
Web Performance Advanced Server Analysis (hp://www.webperformance.com/)- Add-on module for
the Web Performance Inc. Load Tester tool from Web Performance Inc. Automatically points out
performance problems in your operating system or application server; tracks performance counters in
the operating system or application server during a load test, marking those statistics that are obviously
out of spec so you can quickly identify obvious performance problems. Statistics can be viewed during
the test and reviewed later in reports for more detailed analysis.
Eclipse TPTP Testing Tools Project (hp://www.eclipse.org/tptp/index.html)- TPTP (Test & Performance
Tools Platform) is a subproject of Eclipse, an open platform for tool integration. TPTP provides
frameworks for building testing tools by extending the TPTP Platform. The framework contains testing
editors, deployment and execution of tests, execution environments and associated execution history
analysis and reporting. The project also includes exemplary tools for JUnit based component testing
tool, Web application performance testing tool, and a manual testing tool. The project supports the OMG
UML2 Test Prole.
Test Architect (hp://www.logigear.com/products/testarchitect/)- Keyword-driven test automation tool
from LogiGear helps increase test coverage. Built-in
playback support for web-based application and other platforms.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
90 of 165 8/12/2014 6:10 PM
Networking and Server Test Utilities (hp://www.hq42.net/net_tools/)- Small collection of web server
and other test utilities provided by
hq42.net (hp://hq42.net/).
Morae (hp://www.techsmith.com/)- Usability test tool for web sites and software, from TechSmith
Corp. for automated recording, analyzing and sharing of usability data. Consists of 3 components. A
Recorder records and synchronizes video and data, creating a digital record of system activity and user
interaction. A Remote Viewer enables geographically dispersed observers to watch usability tests from
any location; it displays test users computer screen along with a picture-in-picture window displaying
the test participants face and audio; Remote Viewer observers can set markers and add text notes. The
Manager component includes integrated editing functionality for assembly of important video clips to
share with stakeholders.
AutoTestFlash (hp://osash.org/autotestash)- Freeware tool by Tiago Simoes for recording and
playing back UI Tests in ash applications. Source code also available.
Repro (hp://www.reprosoftware.com/)- Manual testing helper tool that records desktop video,
system operations in 7 dierent categories, system resource usage, and system conguration
information. Allows user to save and review relevant information for bug reports, and compress the
result into a very small le to replay, upload to a bug tracking system, and share with others.
Instruments in memory the target application at runtime so no changes are required to application
under test. For Windows.
TestGen (hp://testgen.tigris.org/)- Free open-source web test data generation program that allows
developers to quickly generate test data for their web-services before publicly or internally releasing the
web service for production.
EngineViewer and SiteTimer (hp://www.webscale.com/)- Free basic services: EngineViewer reports
on how a search engine may view a webpage, from how it breaks down the HTML, to which links it
extracts, how it interprets pages robot exclusion rules and more. SiteTimer service Find out how long
it takes various connection types to get a page, check all the graphical links to ensure theyre correct,
examine servers HTTP headers, more.
Fiddler (hp://www.ddlertool.com/ddler/)- An HTTP Debugging tool by Eric Lawrence. Acts as an
HTTP Proxy running on port 8888 of local PC. Any application which accepts an HTTP Proxy can be
congured to run through Fiddler. Logs all HTTP trac between between computer and the Internet,
and allows inspection of the HTTP data, set breakpoints, and ddle with incoming or outgoing data.
Designed to be much simpler than using NetMon or Achilles, and includes a simple but powerful
JScript.NET event-based scripting subsystem. Free, for Windows.
FREEping (hp://www.tools4ever.com/)- Free ping software utility from Tools4ever which will ping all
your Windows-based servers (or any other IP address) in freely-denable intervals. Will send a popup
when one of the servers stops responding.
IP Trac Test and Measure (hp://www.omnicor.com/netest.htm)- Network trac simulation and test
tool from Omnicor Corp. can generate TCP/UDP connections using dierent IP addresses; data creation
or capture and replay; manage and monitor throughput, loss, and delay.
VisitorVille (hp://www.visitorville.com/)- Site trac monitoring tool from World Market Watch Inc.
that depicts website visitors as animated characters in a virtual village; users can watch their web trac
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
91 of 165 8/12/2014 6:10 PM
as if theyre watching a movie.
Sandra (hp://www.sisoftware.co.uk/)- System ANalyser, Diagnostic and Reporting Assistant utility
from SiSoftware. Provides large variety of information about a Windows systems hardware and
software. Includes CPU, mainboard, drives, ports, processes, modules, services, device drivers, ODBC
sources, memory details, environment seings, system le listings, and much more. Provides
performance enhancing tips, tune-up wizard, le system and memory bandwidth benchmarking, more.
Reporting via save/print/fax/email in text, html, XML, etc. Free, Professional, and other versions
available in multiple languages.
Deque (hp://www.deque.com/)- Deque Ramp is a cross-platform solution for testing and remediating
websites and Web-based applications for integrated accessibility and Section 508 compliance. Audits and
corrects accessibility violations and helps organizations develop long-term practices to enhance
accessibility for users with disabilities. Available versions include Ramp Personal Edition, Ramp Grade,
and Ramp Ascend. Ramp PE version is free for some user categories such as non-prot organizations.
Other products include Worldspace Online, an online accessibility test and repair tool.
Browser Cam (hp://www.browsercam.com/)- Service from Gomez Inc./Compuware for web
developers and testers; it creates screen captures of web pages loaded in any browser, any version, any
operating system. Check javascripts, DHTML, forms and other dynamic functionality on any platform.
Allows viewing of web page appearance on Windows, Linux, Macintosh, in most versions of every
browser ever released.
Dummynet (hp://info.iet.unipi.it/%7Eluigi/ip_dummynet/)- Flexible tool developed by Luigi Rizzo,
originally designed for testing networking protocols, can be used in testing to simulate queue and
bandwidth limitations, delays, packet losses, and multipath eects. Can be used on users workstations,
or on FreeBSD machines acting as routers or bridges.
HTTP Interceptor (hp://allhp.com/interceptor/) A real-time HTTP protocol analysis and
troubleshooting tool from AllHTTP.com. View all headers and data that travel between your browser
and the server. Split-screen display and dual logs for request and response data. Interceptor also allows
changing of select request headers on-the-y, such as Referrer and User Agent.
SpySmith (hp://agilethinking.net/qualityforge/)- Simple but powerful diagnostic tool from Quality
Forge; especially useful when testing web sites and web-based applications. It allows the user to peek
inside I.E. Browser-based Documents (including those without a view source command) to extract
precise information about the DOM elements in an HTML source. SpySmith can also spy on Windows
objects. For Windows. Free 90-day trial.
Co-Advisor (hp://coad.measurement-factory.com/)- Tool from The Measurement Factory for testing
quality of protocol implementations. Co-Advisor can test for protocol compatibility, compliance,
robustness, security, and other quality factors. Has modules for HTTP (RFC 2616) and ICAP (RFC 3507)
protocols . Other info: runs on FreeBSD packages, Linux RPMs, Windows (on-demand); available as
on-line service, binaries, or source code.
PocketSOAP (hp://www.pocketsoap.com/)- Packet-capture tool by Simon Fell, with GUI; captures and
displays packet data between local client and specied web server. Can log captures to disk. For
Windows; binaries and source available; freeware. Also available is PocketXML-RPC and PocketHTTP.
TcpTrace (hp://www.pocketsoap.com/)- Tool by Simon Fell acts as a relay between client and server
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
92 of 165 8/12/2014 6:10 PM
for monitoring packet data. Works with all text-based IP protocols. For windows; freeware
ProxyTrace (hp://www.pocketsoap.com/)- Tool by Simon Fell acts as a proxy server to allow tracing of
HTTP data; can be used by seing browser to use it as a proxy server and then can monitor all trac to
and from browser. Freeware.
tcptrace (hp://irg.cs.ohiou.edu/software/tcptrace/tcptrace.html)- Tool wrien by Shawn Ostermann for
analysis of TCP dumples, such as those produced by tcpdump, snoop, etherpeek, HP Net Metrix, or
WinDump. Can produce various types of output with info on each connection seen such as elapsed
time, bytes, and segments sent and received, retransmissions, round trip times, window advertisements,
throughput, and various graphs. Available for various UNIX avors, for Windows, and as source code;
freeware.
MITS.Comm (hp://www.omsphere.com/)- Tool from Omsphere LLC for simulating virtually any
software interface (internal or external). Allows testing without pitfalls associated with live connections
to other systems (TCP/IP, Ethernet, FTP, etc). Allows developers to test down to the unit level by
simulating the internal software interfaces (message queues, mailboxes, etc.) Tool can learn what
request/response scenarios are being tested for future tests and can work with any protocol, any
message denitions, and any network. Also available: MITS.GUI
XML Conformance Test Suite (hp://www.w3.org/XML/Test/)- XML conformance test suites from W3C
and NIST; contains over 2000 test les and an associated test report (also in XML). The test report
contains background information on conformance testing for XML as well as test descriptions for each of
the test les. This is a set of metrics for determining conformance to the listed W3C XML
Recommendation.
Certify (hp://www.worksoft.com/)- Test automation management tool from WorkSoft, Inc. For
managing and developing test cases and scripts, and generating test scripts. For automated testing of
Web, client/server, and mainframe applications. Runs on Windows platforms.
HiSoftware AccVerify (hp://www.hisoftware.com/)- Tool for testing site accessibility, usability,
searchability, privacy and Intellectual Property policy verication; from HiSoftware Inc. Also custom
checks and test suites to meet organizations standards. Can crawl a site and report errors; can also
programmatically x most common errors found. Runs on Windows.
HiSoftware Web Site Monitor (hp://www.hisoftware.com/)- Tool allows user to monitor servers and
send alerts, allows monitoring web sites for changes or misuse of intellectual property in metadata or in
the presented document; link validation. From HiSoftware Inc.
Web Optimizer (hp://www.v-tech.ws/products/wo.htm)- Web page optimizing tool from Visionary
Technologies intelligently compresses web pages to accelerate web sites without changing sites
appearance. Removes unnecessary information in HTML, XML, XHTML, CSS, and Javascript and
includes GIF and JPEG optimizer techniques.
HTML2TXT (hp://www.hdse.org/html2txt/)- Conversion utility that converts HTML as rendered in
MS Internet Explorer into ASCII text while accurately preserving the layout of the text. Included with
software are examples of using the control from within Visual Basic, Visual C++, and HTML.
Team Remote Debugger (hp://www.remotedebugger.com/default_trd.asp)- Debugging tool from
Spline Technologies allows tracing of any number of code units of any kind ( ASP, MTS, T-SQL, COM+,
ActiveX Exe, DLL, COM, Thread, CFML ), wrien in any language ( ASP, VB, VC++, Delphi, T-SQL, VJ,
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
93 of 165 8/12/2014 6:10 PM
CFML ) residing on multiple shared and dedicated servers at the same time, without ever aaching to
process. Remote code can pass messages and dialogs directly to your local machine via Team Remote
Debugger component, and developers can then debug their respective code independently of one
another no maer if the code units reside on the same servers or on dierent servers or on any
combination thereof.
Datatect (hp://www.datatect.com/)- Test data generator from Banner Software generates data to a at
le or ODBC-compliant database; includes capabilities such as scripting support that allows user to
write VBScripts that modify data to create XML output, data generation interface to Segue SilkTest,
capability to read in existing database table structures to aid in data generation, wide variety of data
types and capabilities for custom data types. For Windows.
Triometric Performance Analyzer Suite (hp://www.triometric.net/)- Suite of software protocol
analyzers from Triometric accurately calculates end-to-end download speeds for each transaction, not
just samples; produces a range of congurable reports that breaks down info into network and server
speeds, errors, comparison to SLAs, performance for each server, client, URL, time period, etc.
WebBug (hp://www.cyberspyder.com/) Debugging tool from Aman Software for monitoring HTTP
protocol sends and receives; handles HTTP 0.9/1.0/1.1; allows for entry of custom headers. Freeware.
WebMetrics (hp://zing.ncsl.nist.gov/WebTools/)- Web usability testing and evaluation tool suite from
U.S. Govt. NIST. Source code available. For UNIX, Windows.
MRTG (hp://oss.oetiker.ch/mrtg/) Multi Router Trac Grapher free tool by Tobi Oetiker utilizing
SNMP to monitoring trac loads on network links; generates reports as web pages with GIF graphics
on inbound and outbound trac. For UNIX, Windows.
Automate your repetative tasks on windows
05 SEP 2011 1 Comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
AutoHotkey is a free, open-source utility for Windows. With it, you can:
Automate almost anything by sending keystrokes and mouse clicks. You can write a mouse or
keyboard macro by hand or use the macro recorder.
Create hotkeys for keyboard, joystick, and mouse. Virtually any key, buon, or combination can
become a hotkey.
Expand abbreviations as you type them. For example, typing btw can automatically produce by
the way.
Create custom data-entry forms, user interfaces, and menu bars. See GUI for details.
Remap keys and buons on your keyboard, joystick, and mouse.
Respond to signals from hand-held remote controls via the WinLIRC client script.
Run existing AutoIt v2 scripts and enhance them with new capabilities.
Convert any script into an EXE le that can be run on computers that dont have AutoHotkey
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
94 of 165 8/12/2014 6:10 PM
installed.
For Download use:
hp://www.autohotkey.com (hp://www.autohotkey.com)
Message Box closes automatically using windows shell
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
Dim msg
msg = Message Box automatically close in 5 second
Set oShell = CreateObject(WScript.Shell)
oShell.Popup msg,10, QTP Challenges
In above statement, there are three arguments -
msg the content/string of the message box
10 the time in seconds
QTP Challenges the title of the message box
Working with WMI (Windows Management Infrastructure)
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
Dim ag, AllProcess, AppToRun
AppToRun = ixplore.exe
Flag = Flase
Set AllProcess = GetObject(winmgmts:)
For Each Process In AllProcess.InstancesOf(Win32_process)
If (Instr ((Process.Name), AppToRun) = 1) Then
Print Internet Explorer is running..
Flag = Ture
Exit For
End If
Next
If Flag = Flase Then
Print Internet Explorer not is running..
SystemUtil.Run AppToRun
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
95 of 165 8/12/2014 6:10 PM
End If
You can do the same for any process/application. You just need to change the value of AppToRun
variable.
History of Quick Test Professional
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
QTP 5.5v 2002
QTP 6.5 v & 7.6 (2003 -2004)
QTP8.0 & 8.2 2005
QTP9.0 2008
QTP 9.2 & 9.5 2009
QTP 10 2009
QTP 11 2010
QTP 11 Installation Issues/Errors
05 SEP 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
Notes and Limitations
This section includes the following:
Before You Install
Supplemental Information
:)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
96 of 165 8/12/2014 6:10 PM
Before You Install
This section includes information that is important for you to know before you install QuickTest.
You cannot install QuickTest when a McAfee Anti-Virus application is running.
Workaround: Disable the antivirus application during the QuickTest installation process.
QuickTest Professional supports the Sentinel RMS License Manager version 8.3.0 as its concurrent
license server. Earlier versions of the concurrent license server are not supported.
QuickTest does not support Windows user names with non-English leers. If you log in to Windows
using a user name (with administrative privileges) that contains non-English characters and then
install QuickTest, the installation may complete successfully, but you may not be able to open
QuickTest or it may not behave correctly.
The path in which installation les for QuickTest are located, and the path in which QuickTest is
installed, can contain only English characters.
When upgrading to QuickTest 11.00 from a QuickTest 9.5 or 10.00 installation on which a Language
Pack (localized version of QuickTest) was previously installed, you may get an error message when
opening QuickTest after the upgrade.
Workaround: Repair the installation:
In the Control Panel, select Add/Remove Programs and select the HP QuickTest Professional entry.
Click the Change buon.
In the installation wizard that opens, choose the Repair option and follow the on-screen instructions.
If you install QuickTest 11.00 while the QTPNET_00015 patch (a QuickTest 10.00 patch) is installed
on your computer, QuickTest may behave unexpectedly.
Workaround:
Open the Add/Remove Programs dialog box from the Control Panel.
Display the installed patches by selecting the Show updates check box (or click the View Installed
Updates buon, depending on your operating system version.)
Locate HP QuickTest Professional in the list and check whether QTPNET_00015 for HP QuickTest
Professional 10.00 QFE is listed as an installed update.
If it is installed, click Remove to uninstall this patch before you install QuickTest 11.00.
If you want to work with .NET 4.0, it is best to install it before you install QuickTest. If you install
.NET 4.0 after you install QuickTest, you must manually register two .NET DLLs as follows:
In <QuickTest installation folder>\GlobalAssemblyCache\Net4, execute the following commands:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
97 of 165 8/12/2014 6:10 PM
..\..\bin\GACRegUtil4x86.exe -i Mercury.QTP.Agent.dll
..\..\bin\GACRegUtil4x86.exe -i Mercury.QTP.WpfAgent.dll
In Windows XP and Windows 2003, if you install the Oracle Add-in, the Windows Remote Shell
Service (rshsvc.exe) may fail and display an error message every time you restart the computer. This
occurs only if the Remote Shell Service is congured to run automatically.
Supplemental Information
Use the information in this section as a supplement to the product documentation.
Additional troubleshooting information, guidelines, and feature-specic limitations are described in the
relevant locations of the installation and product documentation. Make sure you are aware of those
issues when working with the relevant features.
This section includes the following:
Installation
Operating Systems
General
Web Add-in
Silverlight Add-in
Quality Center and Business Process Testing
Documentation
Internationalization
Installation
When you install a new QuickTest 11.00 installation and you specify a single concurrent license
server in the License Wizard, QuickTest now automatically species the server in an LSFORCEHOST
environment variable, to optimize performance. However if you perform an upgrade from QuickTest
10.00, and you already had an LSHOST variable dened, the upgrade installation does not change
the seing to LSFORCEHOST.
Workaround: If desired, set the LSFORCEHOST variable manually, as described in the HP Functional
Testing Concurrent License Server Installation Guide.
If you manually set an LSHOST environment variable to a particular server (or upgrade from a
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
98 of 165 8/12/2014 6:10 PM
previous version of QuickTest where the LSHOST variable was set), QuickTest sometimes gets its
license from another server, even when the specied server has the required licenses available.
Workaround: To ensure that a specic server will be used, specify an LSFORCEHOST environment
variable instead.
Operating Systems
If you work with QuickTest on a Windows 7 operating system with User Account Control (UAC) turned
on, and you open a test from a protected location (such as Program Files), it is opened in read-only
mode and a message is displayed that you do not have permissions to open it in read-write mode.
General
When you save a test using the Save Test with Resources option, it also saves any tests containing
called external actions. However, to preserve space, these called tests contain only the called actions,
and not all of the actions from the original test. Therefore, you cannot open these called tests in
QuickTest from the local copy.
Workaround: If you need to have full access to the called tests as well as the main test that you save
using the Save Test with Resources option, then you must manually save all required tests locally and
then manually edit all references to the relevant actions from the main test to the actions it calls.
Web Add-in
The If Handler option in the Web Event Recording Conguration dialog box works on Mozilla
Firefox browsers only if the handler is assigned as an aribute (for example, <A onclick = some
code/>) and not if it is assigned as a property (for example, aObj.onclick = function() {some code})
Silverlight Add-in
When Silverlight applications are opened in two tabs sequentially (without QuickTest performing
any operations on the rst one before the second opens), QTP will use a custom server to support
controls only in the rst application with which you interact. The same is true when two tabs are
refreshed sequentially.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
99 of 165 8/12/2014 6:10 PM
Workaround: Perform an operation (for example, use the Object Spy) with the rst tab
opened/refreshed before opening/refreshing the second one.
If a Web page contains a Silverlight application that is windowless and is scrolled out of view when
the page opens the rst time, QuickTest will not be able to make this application visible. (For
example, in this scenario, QuickTest will not be able to perform an SlvWindow.MakeVisible step).
Quality Center and Business Process Testing
When comparing two baselines, if the only change in a resource is its association to a test or
component, the Asset Comparison Tool does not indicate any change in the resource even though
HP ALM or Quality Center may indicate that the resource is Modied.
If an HP ALM or Quality Center user manually changes the status of a test instance run, HP
ALM/Quality Center creates something called fast run results to record the change of the test status.
The fast run results are not valid QuickTest run results les. However, when you try to select results
to open or delete in the Run Results Viewer or Run Results Deletion tool, the fast run results are
available in the list.
After you run a component locally in QuickTest, you cannot use the Jump to Step in QuickTest
option from the Run Results Viewer.
You cannot perform a remote execution of a business process test on a Windows 2008 R2 QuickTest
computer.
Documentation
The QuickTest Help Index tab contains only reference items, such as objects, methods, properties,
and functions. It does not contain any entries from the user guides.
To search for information from all the documents in the QuickTest Documentation Library, use the
Search tab.
On some operating systems or after installing certain Windows service packs or updates, you may
not be able to view the content of some Help les.
Workaround:
Right-click the CHM le in <QTP installation folder)\help, and click Properties.
In the dialog box that opens, click Unblock.
For details, see hp://support.microsoft.com/kb/902225 (hp://support.microsoft.com/kb/902225)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
100 of 165 8/12/2014 6:10 PM
Internationalization
If you are working with a QuickTest User Interface Pack, install it before running QuickTest for the
rst time, if possible.
If you install a QuickTest User Interface Pack after running QuickTest, the following items may remain
in English after installing the User Interface Pack:
Menus and toolbars in the Object Repository window (in QuickTest or in the Object Repository
Manager)
The Find dialog box in the Expert View
Workaround: Close QuickTest and delete the folder: %APPDATA%\HP\QuickTest Professional
(For example, C:\Documents and Seings\<username>\Application Data\HP\QuickTest Professional).
When working on an operating system using a Spanish locale, you may get an assertion error
message at the beginning of the QuickTest installation.
Workaround: Modify the sLanguage registry key value as follows:
In the Start > Run dialog box, type: regedit.
Go to the registry path: HKEY_CURRENT_USER\Control Panel\International
Change the sLanguage value from ES to ESN
If the above steps do not solve the problem, restart your computer and try again.
Run the QuickTest installation again.
Selecting the View Sample Snapshot option in the QuickTest Asset Comparison Tool opens a
window containing a sample image of the selected element in QuickTest. The image displays the
English user interface.
The Add-in Extensibility SDKs are not localized.
Hello world!
01 SEP 2011 1 Comment
by vsprasad2k in Uncategorized
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
101 of 165 8/12/2014 6:10 PM
Welcome to WordPress.com (hp://wordpress.com/). After you read this, you should delete and write
your own post, with a new title above. Or hit Add New (/wp-admin/post-new.php) on the left (of the
admin dashboard (/wp-admin)) to start a fresh post.
Here (hp://learn.wordpress.com/) are some suggestions for your rst post.
You can nd new ideas for what to blog about by reading the Daily Post
(hp://dailypost.wordpress.com/).
1.
Add PressThis (/wp-admin/tools.php) to your browser. It creates a new blog post for you about any
interesting page you read on the web.
2.
Make some changes to this page (/wp-admin/post.php?post=1&action=edit), and then hit preview on
the right. You can always preview any post or edit it before you share it to the world.
3.
Over and above features provided with QTP 8.2 to QTP9.5
23 AUG 2011 Leave a comment
by vsprasad2k in QTP
Over and above features provided with QTP 9.0 , QTP 9.2 provides following
features:
Mercury Screen Recorder : Dynamic Management of Object Repositories:
Mercury Screen Recorder:
Capture your entire run session in a movie clip or capture only the segments with errors, and then view
your movie from the Test Results window.
Dynamic Management of Object Repositories:
QuickTest now has a new Repositories Collection reserved object that you can use to programmatically
manage the set of object repositories that are associated with an action during a run session.
Over and above features provided with QTP 8.2 , QTP 9.0 provides following
features:
Object Repository Manager: XML Object Repository Format:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
102 of 165 8/12/2014 6:10 PM
Object Repository Merge Tool: Function Library Editor:
Multiple Object Repositories per Action: Handling Missing Actions and
Resources:
Object Repository Manager:
You can use the Object Repository Manager to manage all of the shared object repositories in your
organization from one, central location. This includes adding and dening objects, modifying objects
and their descriptions, parameterizing test object property values, maintaining and organizing
repositories, and importing and exporting repositories in XML format.
You can open multiple object repositories at the same time. Each object repository opens in its own
resizable document window. This enables you to compare the content of the repositories, to copy or
move objects from one object repository to another, and so forth.
Object Repository Merge Tool:
You can use the Object Repository Merge Tool to merge the objects from two shared object repositories
into a single shared object repository. You can also use the Object Repository Merge Tool to merge
objects from the local object repository of one or more actions or components into a shared object
repository.
When you merge objects from two source object repositories, the content is copied to a new, target object
repository, ensuring that the information in the source repositories remains unchanged.
If any conicts occur during the merge, for example, if two objects have the same name and test object
class, but dierent test object descriptions, the relevant objects are highlighted in the source repositories,
and the Resolution Options pane details the conict and possible resolutions.
Multiple Object Repositories per Action or Component:
QuickTest provides several options for storing and accessing test objects. You can store the test objects
for each action or component in its corresponding local object repository, which is unique for each action
and component. You can also store test objects in one or more shared object repositories that can be used
in multiple actions and components. Alternatively, you can use a combination of objects from the local
object repository and one or more shared object repositories. You choose the combination that matches
your testing needs.
XML Object Repository Format:
QuickTest now enables you to import and export object repositories from and to XML format. This
enables you to modify object repositories using the XML editor of your choice and then import them
back into QuickTest. You can import and export les either from and to the le system or a Quality
Center project (if QuickTest is connected to Quality Center).
Function Library Editor:
QuickTest now has a built-in function library editor, which enables you to create and edit function
libraries containing VBScript functions, subroutines, modules, and so forth, and then call their functions
from your test or component.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
103 of 165 8/12/2014 6:10 PM
Handling Missing Actions and Resources:
Whenever a testing document (test, component, or application area) contains a resource that cannot be
found, QuickTest opens the Missing Resources pane and lists the missing resource(s). For example, a test
may contain an action or a call to an action that cannot be found; a testing document may use a shared
object repository that cannot be found; or a testing document may use a object repository parameter that
does not have a default value. In all of these cases, QuickTest indicates this in the Missing Resources
pane, enabling you to map a missing resource to an existing one, or remove it from the testing
document, as required.
Working with XML files using QTP
22 AUG 2011 Leave a comment
by vsprasad2k in Uncategorized, XML Compare Tags: QTP XML Comparision
Extracting XML from a URL or WebBrowser
open internet explorer with xml url
SystemUtil.Run iexplore.exe, hp://mywebsite/set.xml&#8221 (hp://mywebsite/set.xml&#8221);
Browser(creationtime:=0).sync
Get XML Document
Set xmlDoc = Browser(creationtime:=0).WebXML(micClass:=WebXML).GetData()
Save the document locally
xmlDoc.SaveFile C:\File1.xml
Compare two XML Documents:
We can also use XMLUtil in an exteranal VBScript by using the following QTP COM object
Set XMLUtil = CreateObject(Mercury.XMLUtil) QTP XMLData object
Load both XMLs
Set xmlDoc1 = XMLUtil.CreateXMLFromFile (C:\File1.xml)
Set xmlDoc2 = XMLUtil.CreateXMLFromFile (C:\File2.xml)
Use the compare method fo the XML to check if they are equivalent
isEqual = xmlDoc1.Compare(xmldoc2,xmlResults)
If return value of compare method is 1 that mean the les are equal
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
104 of 165 8/12/2014 6:10 PM
If isEqual =1 Then
Msgbox The documents match
Else
Msgbox The documents dont match
End if
QTP Implement Web Extensibility Add-in
21 AUG 2011 Leave a comment
by vsprasad2k in Uncategorized, Web Extensibility Add-in Tags: QTP Web Extensibility Add-in
Using Web Add-in Extensibility, you can implement full support for all QuickTest features for your
controls. You can implement Web Add-in Extensibility support for a set of controls (also referred to as a
toolkit or custom toolkit) by developing a toolkit support set.
Implementing Web Add-in Extensibility consists of the following stages:
1. Planning the Toolkit Support Set
- Determine the set of Web controls that comprise your custom toolkit.
- Dene the test object model by determining which test objects and operations you want to support
based on the controls and business processes supported by your toolkit.
2. Developing the Toolkit Support Set: A Web Add-in Extensibility toolkit support set is comprised of
the following les:
- One test object conguration le, which describes the test object model for your toolkit to QuickTest.
- One toolkit conguration le, which describes which test object class represents each control in the
toolkit and how QuickTest interacts with each control.
- One or more les containing JavaScriptsthat QuickTest can call to perform operations on the custom
controls.
3. Deploying the Toolkit Support Set: To deploy your toolkit support set and enable QuickTest to
support your controls, you need to copy the les you created to specic locations within the QuickTest
installation folder folder.
After you deploy the toolkit support set, when QuickTest opens, it displays your toolkit name as a child
node under the Web Add-in node in the Add-in Manager. If you select the check box for your toolkit,
QuickTest supports the controls in this toolkit using the toolkit support set that you developed.
4. Enhancing the Toolkit Support Set: After you have created and tested basic Web Add-in Extensibility
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
105 of 165 8/12/2014 6:10 PM
support for your controls you can enhance your toolkit support set by using some of the more complex
options to ne-tune your support.
When you develop a Web Add-in Extensibility toolkit support set, you can start by creating a simple and
basic support set and deploying it to QuickTest. This enables QuickTest to recognize your controls
correctly and enables QuickTest user to create and run testson the controls. You can then enhance your
support to enable more complex capabilities, such as ltering the child objects learned with a control
and more advanced handling of events when recording a test.
Exporting the Results of a Query to DataTable
21 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
rst create a datatable to export the data
Set outsheet = DatTable.addsheet(output)
Dim adoRecordSet = adoCon.Execute(strSQL)
dim d
Loop through each eld and get the name to create the data table parameters
For each d in adoRecordSet.Fields
outSheet.AddParameter Replace(d.name,,_)
Next
Loop through all the rows of the query
While adoRecordSet.eof()
For each d in adoRecordSet.Fields
outSheet.GetParameter(Replace(d.name,,_)).value=d.value
Next
adoRecordSet.MoveNext Move on to the next record
Wend
Set adoRecordSet = Nothing

QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
106 of 165 8/12/2014 6:10 PM
Note:
We can even execute a Stored DB procedure using ADODB.Command
Exp:
Set adoCommand = CreateObject(ADODB.Command)
With adoCommand
.ActiveConnection =adoCon
.CommandTimeout = 30
.CommandType = 4 adCmdStoredProc
.CommandText = Authentication

Working with Document Object Model(DOM)
21 AUG 2011 Leave a comment
by vsprasad2k in Uncategorized
What is Document object Model?
A platform- and language-independent standard
object model for representing HTML or XML and
related formats.
For QTPs sake, I would redene it to make it simpler. DOM is a method for QTP engineers to access the
source (IE > View > Source) of any webpage direct through VB Scripting.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
107 of 165 8/12/2014 6:10 PM
When can we use DOM?
One of the very important places you can use it is when a QTP web table checkpoint doesnt show you
the desired content in a cell. I mean the content in the cell is in a format that is not supported by the web
table checkpoint. Another use can be when you want to access all the HTML tags used in a webpage.
You can get the names, the innertext, innerHTML property of all these tags. The possibilities are endless.
How can we use DOM to access the source page?
We can access the source page of any webpage using .objectnotation.
Any practical example of using DOM?
I have created a demo web page to show you document object model in action. Say you want to nd the
font color used for writing HappyHolidays Everyone in cells of the webtable given on this page. The
algorithm would be:
Access the DOM of webtable using .object notation. 1.
Access the tagname corresponding to the property you wish to nd out. In our case tagname is
font and property to be explored is color.
2.
Find the count of total number of tags and loop it nd out the font-color. 3.
QuickTestProfessional 11-New Features
21 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks Tags: QTP11 New Features
QuickTest 11-New Features (hp://qtpchallenge.les.wordpress.com/2011/08/quicktest-11-new-
features.doc)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
108 of 165 8/12/2014 6:10 PM
Reading data from excel at one go using vb scripting
12 AUG 2011 Leave a comment
by vsprasad2k in Uncategorized
Dim intArray stores the data as array
intArray =xlworksheet.UsedRange Get the range which has data
rowcount = UBound(intArray,1) Geing the size of the array
colCount=UBound(intArray,2)
Loop through the array
For i = LBound(iArray,1) to rowCount
For j=LBound(iArray,2) to colcount
Msgbox intArray(i,j)
Next
Next
Features and Tips of QTP 10.0v
12 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
You can create multiple application areas to suit dierent components. 1.
NEW!! Business components associated with an application area use only the resources and
seings that are dened in the application area. In previous versions of QuickTest Professional,
business components could have custom seings.
2.
The RegisterUserFunc statement now has an optional argument that you can use to set a function
as the default operation for a test object.
3.
You can use the new Function Denition Generator to easily generate user-dened functions
(Insert > Function Denition Generator).
4.
Iterations for a business component are dened in Quality Center. 5.
The Operation item appears in the Keyword View only when functions are dened in function
library les associated with the components application area.
6.
1.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
109 of 165 8/12/2014 6:10 PM
NEW!! You can manage the availability of keywords used to create keyword-driven components
using the new Keywords pane in the application area of QuickTest Professional.
7.
The Function Denition Generator enables you to add documentation that species exactly what
a step using your function does. This description is shown in the Documentation column of the
Keyword View for steps that use the function.
8.
NEW!! You can associate a function library with the open test by opening the function library and
choosing File > Associate Library library_name with test_name.
9.
NEW!! You can check syntax errors by clicking CTRL + F7. If your script contains errors you can
view them in the new Information pane.
10.
When adding a new step using the Keyword View or Step Generator, you can select a new object
from your application and it is automatically added to your object repository.
11.
You can specify which columns you want to display in the Keyword View. Choose Tools > View
Options or right-click any column header in the Keyword View.
12.
You can specify the order in which columns are displayed in the Keyword View. Choose Tools >
View Options or drag a column header to a new location in the Keyword View.
13.
You can print the contents of the Keyword View to your Windows default printer, or preview it
on screen before printing. Click the Print buon or choose File > Print.
14.
You can copy and paste or drag and drop steps in order to move them to a dierent location
within the Keyword View.
15.
You can enter a comment about a step in the Keyword View by clicking in the Comment cell. You
can also enter a comment on a new line below the currently selected step by choosing Insert >
Comment.
16.
You can view the Documentation column in the Keyword View to read a summary of what the
step does, in an easy-to-understand sentence.
17.
NEW!! You can copy the content of the Documentation column to the Clipboard by right-clicking
any column header in the Keyword View and choosing Copy Documentation to Clipboard.
18.
The Select Object for Step dialog box enables you to select a new object from your application. If
you select an object in your application that is not in the object repository, the object is added to
the object repository when you insert the new step.
19.
If you are connected to Quality Center, you can view the current Quality Center connection by
pointing to the Quality Center icon in the status bar. To open the Quality Center Connection
dialog box, double-click the Quality Center icon.
20.
If a Quality Center test or shared le (such as a shared object repository or Data Table le) is open
when you disconnect from Quality Center, then QuickTest closes it.
21.
To access QuickTest tests or components from Quality Center, select the Allow other Mercury
products to run tests and components check box (Tools > Options) and install the QuickTest
Add-in for Quality Center (from the QuickTest Professional CD-ROM).
22.
NEW!! If a business component is currently open, clicking the New toolbar buon creates a new
business component document (and not a new test document). This also applies if an application
area or function library is open.
23.
NEW!! You can open a recently used business component, application area, or function library by
selecting it from the Recent Files list in the File menu.
24.
You can specify test, action, or component parameters to pass values to and from your test or
business component, and between actions in your test.
25.
You can dene test or action parameter variables using the Parameter object and its methods in
the Expert View.
26.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
110 of 165 8/12/2014 6:10 PM
You can create test, action, or component parameter output values that retrieve values during the
run session and store them for use at another point in the run session. You can then use these
output values to parameterize a step in your test or business component.
27.
NEW!! You can create object repository parameters. When associating an object repository to a
test asset, you map this parameter to a constant or a test asset parameter (test, action, or business
component).
28.
You can select an object in the object repository and locate it quickly in your application using the
Highlight buon in the ORM or ORE.
29.
NEW!! You can locate an object in the object repository by pointing to an object in your
application. If the object exists in the object repository, it is highlighted.
30.
NEW!! You can now add new objects to the object repository using ltering capabilities. For
example, you can choose to add only a selected type of object residing in a window or a web
page/frame.
31.
NEW!! You can now associate multiple object repositories with an action or application area. In
previous versions of QuickTest Professional, you could associate only a single object repository
with a test asset.
32.
NEW!! You can export object repository content to an XML le and import a new object
repository from an XML le.
33.
The list of Utility objects available when you open the Step Generator from the Keyword View is
a sub-group of the list available when you open the Step Generator from the Expert View.
34.
Open XML format used for report information now enables you to easily customize run reports
and integrate result information with other applications. Refer to the QuickTest online
documentation for a detailed description of the reports XML elements.
35.
You can export test results to an HTML le to easily view the test results when you are not
working in a QuickTest environment.
36.
You can write automation scripts to control virtually every QuickTest feature and capability using
the objects, methods, and properties included in the QuickTest Professional automation object
model.
37.
Test object and method names are not case sensitive. 38.
When you type VBScript keywords in the Expert View, the relevant VBScript syntax or blocks are
added to the test script.
39.
You can now locate specied text strings in the Expert View, and replace them with text strings
that you specify. You can search for literal text or use advanced options to ne-tune your search.
40.
NEW!! You can select a block in the Expert View and press CTRL + M to comment this block.
Press SHFT + CTRL + M to uncomment the block.
41.
NEW!! You can select a block in the Expert View and indent or outdent it by clicking the Indent or
Outdent toolbar buons.
42.
NEW!! You can control the layout of the QuickTest Professional Window by dragging and
dropping panes to a dockable, oating, and tabbed mode.
43.
NEW!! To move a dockable pane without snapping it into place, press CTRL while dragging it to
the required location.
44.
NEW!! To auto-hide all the tabbed panes, select the title bar of the active tabbed pane, right-click
and choose Auto Hide.
45.
NEW!! When you rename a test object, you can choose whether to automatically update all
occurrences of the test object, or manually change the names in steps that use the renamed test
objects.
46.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
111 of 165 8/12/2014 6:10 PM
NEW!! You can copy objects from a shared object repository to the local object repository in order
to modify them.
47.
NEW!! You can use the Object Repository Merge Tool to merge objects from two shared object
repositories into a single object repository.
48.
NEW!! You can associate shared object repositories with multiple actions simultaneously, using
the Associate Repositories dialog box.
49.
NEW!! You can resolve missing resources (such as missing object repositories and actions), using
the new Missing Resources pane.
50.
You can print a single action or business component from the Keyword View (in table format) or
the from the Expert View (in statement format).
51.
In addition to Data Table output values, you can output values to environment variables or store
a retrieved value in a test, action, or component parameter.
52.
You can use the Advanced Windows Applications Options dialog box to modify how QuickTest
records and runs tests on Windows applications. Choose Tools > Options > Windows
Applications tab > Advanced.
53.
You can save the resulting data from the run-time Data Table to a le by inserting a
DataTable.Export statement to the end of your test.
54.
To instruct QuickTest to wait for an object to open or appear during test run, use an Exist or Wait
statement.
55.
To stop an analog step in the middle of a test run, click Ctrl + Esc, then click the Stop toolbar
buon.
56.
If you want to create a bitmap checkpoint of multiple objects, select the object in the Object
Selection dialog box that includes all the objects you want your bitmap checkpoint to contain.
57.
If you need to recover Active Screen les after you save a test without Active Screen les,
re-record the necessary steps or use the Update Run option to recapture screens for all steps in
your test.
58.
You can use a PathFinder.Locate statement in your test to retrieve the complete path that
QuickTest uses for a specied relative path based on the folders specied in the Folders tab.
59.
To maximize performance, load only the add-ins you need. 60.
You can dene a recovery scenario to handle unexpected behavior during your run session. 61.
You can add new objects to the Object Repository from the Active Screen or using the Add
Objects option in the Object Repository dialog box and pointing to the object in your application.
62.
To record keyboard input, mouse clicks, and the exact path the mouse travels, switch to Analog
Recording mode or Low Level Recording mode.
63.
If it takes time for an object you are checking to load all of its data, you can increase the
checkpoint timeout.
64.
You can insert XML output values to your script. 65.
You can verify that your XML is structured according to a specic schema. 66.
You can specify a relative path when calling actions, functions, and other external les associated
with or referenced by a test or business component.
67.
NEW!! You can create library les (containing VBScript functions, subroutines, classes, modules,
and so forth) in QuickTest Professional and associate them with your test or application area. You
can then call these functions (or other elements) from within your test assets.
68.
NEW!! You can debug functions, subroutines and classes dened in a function library le in
QuickTest Professional.
69.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
112 of 165 8/12/2014 6:10 PM
You can create a user-dened function and register it as a test object method in order to overwrite
or add to existing test object functionality.
70.
You can use the Data Driver Wizard to automatically parameterize constants in your action or
business component.
71.
You can use the Reporter object to disable or enable messages to the Test Results. 72.
You can record a test on one version of Microsoft Internet Explorer and then run it on other
browsers or versions.
73.
To transfer control to the application while spying or inserting checkpoints on objects, press the
CTRL key.
74.
You can check the content of an image in a Web page when you create an image checkpoint using
the Compare Image Content option.
75.
You can use the Data Table to run the test several times, each time using dierent data. 76.
By default, in order to conserve disk space, QuickTest does not save screen captures with your
test results for steps that pass. You can change the default seing in the Tools > Options > Run
tab.
77.
The Active Screen loads faster if you clear the Load Images check box in the Web Page
Appearance dialog box (Tools > Options > Active Screen tab > Advanced buon).
78.
You can create a custom report message from the Keyword View by choosing Insert > Report. 79.
You can teach QuickTest to recognize any area of your application as an object by dening it as a
virtual object.
80.
From QuickTest, you can run WinRunner tests and call TSL functions in compiled modules. The
results of the WinRunner test or function are integrated into the QuickTest test results.
81.
To modify the text used for a text checkpoint, click the Congure buon in the Text Checkpoint
Properties dialog box.
82.
You can congure an action for repeated use in your test and in other tests. Select the Reusable
Action check box in the Action Properties dialog box (Edit > Action > Action Properties).
83.
You can use the ExitAction statement to terminate an action before it nishes running, based on
conditions you specify in your test.
84.
You can run QuickTest tests from a Quality Center project and pass parameter values to the test. 85.
You can set breakpoints in your test, and then use the Debug Viewer pane to view, set, or modify
the current value of objects or variables.
86.
You can call methods and retrieve and set COM object properties from the Expert View using the
.Object property.
87.
You can congure how QuickTest records events in Web applications. Choose Tools > Web Event
Recording Conguration.
88.
You can dene custom environment variables for use in your test. 89.
You can add logic to a checkpoint by using a Data Table formula. 90.
You can set a parameter to use a random numeric value. 91.
You can use the Window Script Host and the VBScript Runtime Library to further extend your
test. For more information choose Help > QuickTest Professional Help > VBScript Reference.
92.
You can use the Object Identication dialog box to congure the way QuickTest learns and
recognizes objects.
93.
You can run your test in Update mode to update values in your test or business component. You
can choose to update checkpoint data, Active Screen images, and/or the descriptions of the objects
in the object repository. Choose Automation > Update Run Mode.
94.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
113 of 165 8/12/2014 6:10 PM
94.You can choose a Web server accessible via a Local Area Network (LAN) or a Wide Area Network
(WAN) when connecting to Quality Center. Click the Quality Center Connection buon or choose
File > Quality Center Connection.
The Open Test from Quality Center Project dialog box displays icons that indicate the version
control status of each test in your project.
1.
If you want to add the same comment to every action that you create, you can add the comment
to an action template.
2.

Sample QTP Certification Questions Part1
12 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
To use a specic property to identify your object, but that property is not listed in the properties list.
Then how do you identify that object?
1.
Add the specic property to the list 1.
Use the Default property 2.
Use some other property to identify your object 3.
The list of test objects and their properties and values are stored in the 2.
Object Repository 1.
Object Identication 2.
To retrieve the current property value of the objects in your application during the run session. 3.
GetVisibleText 1.
GetROProperty 2.
SetROProperty 3.
GetTOProperty 4.
Bitmap checkpoint is supported in VB environment. 4.
True 1.
False 2.
What is the shortcut key that is used for a Standard Checkpoint? 5.
F12 1.
F2 2.
F10 3.
F7 4.
To compares the values of the specied property during a run session with the values stored for the 6.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
114 of 165 8/12/2014 6:10 PM
same test object property within the test.
Checkpoint 1.
All the above 2.
Output Value 3.
Compare the object property 4.
You will use the recording mode for an object not recognized by QuickTest. 7.
Low-Level Recording Mode 1.
Normal recording Mode 2.
Analog Mode 3.
The statement that calls the recorded analog le is 8.
RunAnalog 1.
CallAnalog 2.
ExecuteAnalog 3.
An action can be called by other tests or actions is 9.
Call Action 1.
SplitAction 2.
Reusable Action 3.
You can replace the page in your Active Screen tab 10.
False 1.
True 2.
QuickTest adds a checkpoint statement in the Expert View as 11.
Check Checkpoint 1.
Checkpoint 2.
A Checkpoint checks that a text string is displayed within a dened area in a Windows application is 12.
Accessibility 1.
Text Area 2.
Standard 3.
Text 4.
In ActiveX environment an Accessibility checkpoint is supported. 13.
No 1.
Yes 2.
The key that is used to Start/End analog recording mode? 14.
F3 1.
SHIFT+ALT+F3 2.
CTRL+SHIFT+F3 3.
F10 4.
15.
The toolbar enables you to view the details of an individual action or the entire test ow is 16.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
115 of 165 8/12/2014 6:10 PM
Testing toolbar 1.
None of the above 2.
Action toolbar 3.
Test Pane 4.
Answers:
c 1.
B 2.
A 3.
A 4.
B 5.
A 6.
A 7.
A 8.
A 9.
A 10.
C 11.
B 12.
A 13.
B 14.
A 15.
A 16.
1.
HP QTP 11.0 Sample Questions for Certifications
04 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
1. How can you add recordable or non-recordable operations to your test? (Select three.)
A. Use the Step Generator.
B. Insert through Keyword View.
C. Drag objects from the object repository.
D. Drag objects from the Active Screen.
E. Drag objects from Available Keywords.
F. Drag objects from the Data Table.
Answer: ABE
2. What is a QuickTest Professional test comprised of?
A. calls to actions
B. calls to actions (reusable only)
C. calls to QuickTest Professional tests
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
116 of 165 8/12/2014 6:10 PM
D. calls and copies of actions
Answer: A
3. Which names are used to identify the status of your application before and after your automated
test executes? (Select two.)
A. initial condition
B. static state
C. end condition
D. down condition
E. done condition
Answer: AC
4. During the planning phase, you decide to create multiple actions that can be combined and reused
to achieve testing goals. Which element is critical for identifying the actions to be recorded and how
to combine them?
A. input data
B. parameters
C. initial and end conditions
D. visual cues
Answer: C
5. What are the default add-ins installed with QuickTest Professional? (Select three.)
A. .NET
B. ActiveX
C. HTML
D. Web
E. Java
F. OCX
G. Visual Basic
Answer: BDG
6. Which Quick Test Professional View Option will show you the repositories associated with each
action?
A. Resources
B. Information
C. Script Repository
D. Active Screen
Answer: A
7. Where can you reset the add-in manager if it does not display when you launch QuickTest
Professional?
A. General Options
B. Run Options
C. Test Properties
D. Test Seings
Answer: A
8. You set your Record and Run seings to Record, and then run a test on any open browser. Which
applications will be recorded? (Select two.)
A. Firefox
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
117 of 165 8/12/2014 6:10 PM
B. Safari
C. Silverlight
D. Chrome
E. Internet Explorer
Answer: AE
HP AIS Certification on QTP 11.0 and QC 11.0
04 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks Tags: AIS, HP, HP QTP 11.0 Certication
HP Brings New Certication Exams for QTP 11.0 & QC 11.0 from July 2011
HP has phased out the AIS HP Quality Center v10 certication from 01 July 2011.
Let us see a quick comparison as to what was the situation earlier versus what is now.
Sr. What was Earlier? What is available Now?
1. AIS HP Quality Centercertication used to
be awarded after clearing two exams like
1) QTP 10.0
&
2) QC 10.0
HP AIS certication is now being awarded
upon clearing just a single exam either
focussing on 1) QTP 11.0
or
2) Quality Center 11.0.
2. HP QuickTest Professional 10.0 Software
(Exam Code: HP0-M39)
HP Functional Testing 11.x software (Exam
Code: HP0-M47)Short name FTv11
3. HP Quality Center 10.0 Software (Exam Code:
HP0-M31)
HP Application Lifecycle Management 11.x
Software (Exam Code: HP0-M46)Short name
ALM v11
4.
Certication exams had been active till 31
st
July 2011
Certication exams are active from 15
th
May
2011
Summary of New Certications:
HP AIS (Accredited Integration Specialist) certication is now being awarded upon clearing just a single
exam focussing either on QTP 11.0 or Quality Center 11.0.
For geing AIS HP certications, following two independent paths are available now.
1) For aspirants willing to get certication focussing on QTP 11.0 the available exam is HPO-M47
(Functional Testing 11.x software).
2) For aspirants willing to get certication focussing on QC 11.0 the available exam is HPO-M46 (HP
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
118 of 165 8/12/2014 6:10 PM
Application Lifecycle Management 11.x Software).
A)Highlights ofNew QTP 11.0 Exam: New exam HP0-M47 replaces old HP QuickTest Professional 10.0
exam HP0-M39.
a) The new certication is now being called HP AIS Functional Testing v11
b) Exam details:
# Number of Questions: 72
# Type of Question: multiple choice, drag-and-drop, and point and click
# Exam time: 105 minutes
# Passing score: 75%
The following testing objectives represent the specic areas of content covered in the exam.
The exam HPO-M47 measures the candidates understanding of these areas.

Coverage % Sections / Objectives
10% Automated test planning# Plan for general testing and automation.
# Plan for QTP testing.
# Identify and describe features and seings.
# Explain QTP licensing and packaging.
19% Basic test creation and how QTP works with objects
# Create the basic test.
# Explain how QTP works with objects.
# Add steps without recording.
# Explain the purpose and operation of Smart Identication feature.
24% Basic test verication and enhancement# Add standard and custom
verication points.
# Enhance tests with parameters.
# Add custom checkpoints.
# Add database checkpoints.
# Add bitmap checkpoints.
# View test results.
11% Modular automated test builds# Explain how to build modular QTP tests with
Actions.
# I Use a Shared Object Repository.
7% QTP and ALM integration # Explain the QTP/ALM connection.
# Dene ALM management of QTP resources.
# Explain versioning features in QTP
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
119 of 165 8/12/2014 6:10 PM
10% Automated test troubleshooting# Troubleshoot Object Recognition problems.
# Use Recovery scenarios.
# Use the Debugging Tool.
# Measure System Performance.
# Congure log tracking.
4% Advanced QTP Scripting# Import and export Excel sheets.
# Get and set object properties.
# Identify descriptive programming to bypass repository.
7% Expert View# Describe Expert View features.
# Describe dynamic object programming.
# Identify and describe VBScript elements.
8% Web applications# Recognize Web Add-in Extensibility.
# Describe Web event recording use and conguration.
# Identify new web testing capabilities.
New Features of QuickTest Professional
# Visual Relation Identication
# Log Tracking
# Improved Regular Expressions
# New Results Viewer
# GUI and GUI-Less Testing
# Loading Function Libraries at Run-Time
B)Highlights ofNew QC 11.0 Exam: New exam HP0-M46 replaces old HP Quality Center 10.0 exam
HP0-M31
The new certication is now being called HP AIS Application Lifecycle Management v11 known by an
abbreviation ALM v11.
HP Application Lifecycle Management provides a centralized platform for managing and automating
the application lifecycle, from inception to retirement. It empowers application teams to plan, build and
release beer-quality applications with fewer delays.
New Features of QC / ALM v11

Sr. New Features Details
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
120 of 165 8/12/2014 6:10 PM
1. Project Planning &
Tracking
# Track & measure project milestones and KPIs
# Release Milestones & KPIs# Master Plan
# Scorecard
# Dashboard
2. Requirements
Management
enhancements
# Business Process Model -INTEGRATION# New Rich Text
Editor
# Requirements Templates
3. Test Management # Test Congurations
4. HP Sprinter (Manual
Testing)
# Connects directly to HP Quality Center# Test Execution
# Screen Annotation and Tools
# Log defects in QC
# Data Injection
# Exploratory Testing
# Mirror Testing
5. Development
Management
# Key Developer Integration and Collaboration
6. Reporting enhancements # Generate Reports# Embedded Web Scorecards & Graphs
7. Administration and
Integration and
Performance
# Side by Side Clients:Allows running multiple clients
connecting to dierent versions of ALM and QC Servers (ALM
11; QC 9.2, 10.0, 11.0)# Client Installation: User can install client
on desktop without system administration rights
# REST APIs: New web services technology for simple
integration with ALM platform. The ALM Synchronizer now
leverages the REST APIs.
# QC Sense: Internal monitoring tool that collects data and
reports on user actions performed in the user interface, and all
client and server activity resulting from those actions
# Smart Repository: Optimized repository system, that creates
beer performance for common actions, and reduces the size of
the le system
Features in Nutshell:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
121 of 165 8/12/2014 6:10 PM
When you earn the HP AIS HP Application Lifecycle Management v11 certication, you prove that
you have mastered the skills to be able to:
# Centrally manage and track all application projects
# Aain real-time visibility into the application lifecycle
# Centrally manage and enforce consistent work-ows and processes
# Reduce duplication of eort across projects
# Provide an aggregated, cross-application project view of quality status and defect trends
# Facilitate collaboration and communication among internal and external stakeholder groups, across
multiple projects
Test Automation Challenges in Agile Environment
01 AUG 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
Test Automation Challenges in Agile Environment
In this article let us analyze some of challenges we face while implementing Automation with Agile
methodologies. Automated testing in the Agile environment stands a risk of becoming chaotic,
unstructured and uncontrolled.
Agile Projects present their own challenges to the Automation team; Unclear project scope, Multiple
iterations, Minimal documentation, early and frequent Automation needs and active stakeholder
involvement all demand lot of challenges from the Automation Team. Some of these challenges are:
Challenge 1: Requirement Phase Challenge 4: Resource Management
Challenge 2: Selecting the Right Tools Challenge 5: Communication
Challenge 3: Script Development Phase Challenge 6: Daily Scrum Meeting
Challenge 7: Release Phase
Challenge 1: Requirement Phase
Test Automation developer captures requirements in the form of user stories, which are brief
descriptions of customer-relevant functionality.
Each requirement has to be prioritized as follows:
High: These are mission critical requirements that absolutely have to be done in the rst release
Medium: These are requirements that are important but can be worked around until implemented.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
122 of 165 8/12/2014 6:10 PM
Low: These are requirements that are nice-to-have but not critical to the operation of the software.
Once priories are established, the release iterations are planned. Normally, each Agile release iteration
takes between 1 to 3 months to deliver. Customers/software folks take liberty to make too many changes
to the requirements. Sometimes, these changes are so volatile that the iterations are bumped o. These
changes are greater challenges in implementing Agile Automation testing process.
Challenge 2: Selecting the Right Tools
Traditional, test-last tools with record-and-playback-features force teams to wait until after the software
is done. More over, traditional test automation tools dont work for an Agile context because they solve
traditional problems, and those are dierent from the challenges facing Agile Automation teams.
Automation in the early stages of an agile project is usually very tough, but as the system grows and
evolves, some aspects sele and it becomes appropriate to deploy automation. So the choice of testing
tools becomes critical for reaping the eciency and quality benets of agile.
Challenge 3: Script Development Phase
The Automation testers, developers, business analysts and project stakeholders all contribute to kick-o
meetings where user-stories are selected to next sprint. Once the user-stories are selected for the
sprint, they are used as the basis for a set of tests.
As functionality grows with each iteration, regression testing must be performed to ensure that existing
functionality has not been impacted by the introduction of new functionality in each iteration cycle. The
scale of the regression testing grows with each sprint and ensures that this remains a manageable task
the test team use the test automation for the regression suite.
Challenge 4: Resource Management
The Agile approach requires a mixture of testing skills, that is, test resource will be required to dene
unclear scenarios and test cases, conduct manual testing alongside developers, write automated
regression tests and execute the automated regression packages. As the project progresses, specialist
skills will also be required to cover further test areas that might include integration and performance
testing. There should be an appropriate mix of domain specialist who plan and gather requirements.
The challenging part in the Resource management is to nd out test resources with multiple skills and
allocate them.
Challenge 5: Communication
Good communication must exist among Automation testing team, developers, business analysts and
stake holders. There must be highly collaborative interaction between client and the delivery teams.
More client involvement implies more suggestions or changes from the client. It implies more
bandwidth for communication. The key challenge is that the process should be able to capture and
eectively implement all the changes and data integrity needs to be retained. In traditional testing,
developers and testers are like oil and water, but in agile environment, the challenging task is that they
both must work together to achieve the target.
Challenge 6: Daily Scrum Meeting
Daily Scrum Meeting is one of the key activities in Agile Process. Teams do meet for 15 minutes stand
up sessions. What is the eectiveness of these meetings? How far these meetings help Automation
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
123 of 165 8/12/2014 6:10 PM
practice Developers?
Challenge 7: Release Phase
The aim of Agile project is to deliver a basic working product as quickly as possible and then to go
through a process of continual improvement. This means that there is no single release phase for a
product. The challenging part lies in integration testing and acceptance testing of the product.
If we can meet these challenges in a well optimized manner, then Automated Regression Testing in
Agile environment is an excellent opportunity for QA to take leadership of the agile processes. It is
beer placed to bridge the gap between users and developers, understand both what is required, how it
can be achieved and how it can be assured prior to deployment. Automation practice should have a
vested interest in both the how and the result, as well as continuing to assure that the whole evolving
system meets business objectives and is t for purpose.
How To Be a Good Team Mentor, Coach and a True
Team-Defender in an Agile Testing World? The Inspiration
You must be impressed with the Idea AD and this time it is back with the Walk when you talk idea.
Abhishek Bacchan, who appears as a doctor in Walk when you talk AD, this is a denitely out of an
ordinary AD, but then, I wouldnt expect anything else from the Idea AD; I love to see the AD and its
one of my favorite AD since its place in line with my emotion and I hope with some of yours emotion as
well.
Is it just an AD in changing the health and mind-set of people or an AD to increase the mobile
connection sales?
How to Deliver High Value Software Features in a Short
Time Period using Agile Scrum Process
What is agile scrum (sprint) process?
Scrum is a software development process. In todays rapid world stakeholders want immediate return
on their investments. They dont want to wait for longer periods to get full featured product. As a result,
nowadays new software development and testing framework is catching momentum i.e. Scrum
approach.
In scrum, projects are divided in small features to be developed and tested in specic time-frames called
as sprint (small cycles). Features should get developed and tested in specied small time-frames. This
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
124 of 165 8/12/2014 6:10 PM
agile scrum team is handled by scrum master.

Working with DLLs using QTP
01 AUG 2011 Leave a comment
by vsprasad2k in Uncategorized
What is a DLL?
Dynamic Linked Library is MS implementation of shared library concept in Windows. To understand
this term more clearly, DLL can be broken down into Dynamic Link(ed) + Library
Dynamic Link means that the subroutines of a library are loaded into an application program at
runtime (hp://en.wikipedia.org/wiki/Runtime), rather than being linked in at compile time
(hp://en.wikipedia.org/wiki/Compile_time), and remain as separate les on disk.
Library is a collection of subroutines
How to know about the functions in a DLL?
It is assumed that if you intend to call a DLL, you should know the function to be called from inside and
what that function does. If you are clueless about how to get the function names you can get download
Microsoft Dependency Walker (hp://en.wikipedia.org/wiki/Dependency_walker) or a 3rd party utility
called PE Explorer (hp://www.heaventools.com/PE_Explorer_Exports_Viewer.htm) which can help
you to nd the functions.
How can the functions inside DLL be called from QTP?
This part is actually simple and a two step process
Declare the method using Extern.Declare
Example
Extern.Declare micHwnd, FindWindow, user32.dll, FindWindowA, micString, micString
where:
micHwnd -the data type of value returned by method
FindWindow -the user supplied procedure name. You can set it to anything as long as its a valid
syntax.
user32.dll -the DLL from where you wish to call the method
FindWindowA -The actual method name inside the DLL
Last two are the data types of the arguments that will be passed to the procedure
Call the method
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
125 of 165 8/12/2014 6:10 PM
Example:
Extern.FindWindow(Notepad, vbNullString)
To show the above process in action, here is an example to change the title of the Notepad window by
calling the user32.dll

1: Declare FindWindow method
2: Extern.Declare micHwnd, FindWindow, user32.dll, FindWindowA, micString, micString
3:Declare SetWindowText method
5: Extern.Declare micLong, SetWindowText, user32.dll, SetWindowTextA, micHwnd, micString
7: Get HWND of the Notepad window
8: hwnd = Extern.FindWindow(Notepad, vbNullString)
10: if hwnd = 0 then
12: MsgBox Notepad window not found
14: end if
16: Change the title of the notepad window
17: res = Extern.SetWindowText(hwnd, LearnQTP.com)
Simple copy-paste the code above in your QTP Expert View. Open a blank notepad window. Run this
code. You will now see that the name has changed from Untitled-Notepad to LearnQTP.com
Working on E-mails in Outlook using QTP
31 JUL 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
Looking for an E-mail in Outlook
QuickTest Professional does not have special support for the Outlook application, so there is no built-in
method that will locate an e-mail and allow you to view the aachments. However, Microsoft does have
an Object Model for Outlook that can be used to automate many of the features. You can refer to
Microsoft Outlook 2000 Object Model for a complete listing of Outlook methods and properties that
can be used within a QuickTest Professional (QTP) script. You can use these Outlook object methods
within a QTP script to send e-mails, access address libraries, access mail folders, etc.
For a complete listing of Outlook objects methods and properties, refer to MSDN Library Microsoft
Outlook Object Model.
Below is an example of a very simple VBScript function. This will work on the Inbox items. The script
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
126 of 165 8/12/2014 6:10 PM
will list how many items you have in the inbox, whether those are read or unread and also the subject.
Note:
In the code below, the GetDefaultFolder() function uses a constant. If you want to work with other
folders, here are the constants (the code will not work with the Personal folder):
DeletedItems = 3
Outbox = 4
SentMail = 5
Inbox = 6
Calendar = 9
Contacts = 10
Journal = 11
Notes = 12
Tasks = 13
Drafts = 16
AllPublicFolders = 18
Example:
const olMailItem = 0
Set objOutlook = CreateObject(Outlook.Application) Create an Outlook object to interact with.
Set myNameSpace = objOutlook.GetNameSpace(MAPI)
Set ClientFolder = myNameSpace.GetDefaultFolder(6)
msgbox(ClientFolder.Items.Count)
Set myItems = ClientFolder.Items
Set myItem = myItems.GetFirst
for i=1 to ClientFolder.Items.Count
msgbox(myItem.UnRead)
msgbox(myItem.Subject)
Set myItem = myItems.GetNext
next
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
127 of 165 8/12/2014 6:10 PM
Types of Automation Framework
31 JUL 2011 Leave a comment
by vsprasad2k in Uncategorized
Types of Test Automation Frameworks
You may be aware that using only a capture tool to create your automated tests has its drawbacks, but
you may not be aware of the alternatives you have available to you. In this article I will briey outline
some of the frameworks for test automation that Im aware of. These include test script modularity, test
library architecture, keyword-driven/table-driven testing, data-driven testing, and hybrid test
automation. Each of these frameworks has its own strengths and weaknesses. What I hope to
accomplish in this article is to establish a starting point from which you can spend some time looking
more heavily into the framework you think may be right for you.
Frameworks for Test Automation

Test Script Modularity
The test script modularity framework is the most basic of the frameworks. This framework builds on
the concept of abstraction.
Its a well-known programming strategy to build an abstraction layer in front of a component to hide
the component from the rest of the application.
This insulates the application from modications in the component and provides modularity in the
application design.
When working with test scripts (in any language or proprietary environment) this can be achieved
by creating small, independent scripts that represent modules, sections, and functions of the
application-under-test.
You then take these small scripts and combine them in a hierarchical fashion to construct larger tests.
The use of this framework will yield a higher degree of modularization and add to the overall
maintainability of your scripts. This framework being what it is, I did not see t to include any
examples.
Test Library Architecture
Following the same rule of abstraction, one can also implement a test library architecture framework.
This framework oers the same advantages as script modularity, but it divides the application-
under-test into procedures and functions (or objects and methods depending on your
implementation language)
instead of scripts.
This framework requires the creation of library les that represent modules, sections, and functions
of the application-under-test.
These library les are then called directly from your test case scripts. Much like script
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
128 of 165 8/12/2014 6:10 PM
modularization this framework also yields a high degree of modularization and adds to the overall
maintainability of your tests.
Like the last framework, I did not see t to include any examples for this framework either.

Keyword-Driven or Table-Driven Testing
The terms keyword-driven testing and table-driven testing are interchangeable and refer to one type
of an application-independent automation framework.
This framework 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.
As an example, if we were to map out the actions we would perform while testing the Open function in
Word, we could create the following table. The Window column refers to which application window we
are performing the mouse action on. The Control column refers to the type of control that the mouse
will be clicking. The Action column is the action taken with the mouse (or by you the tester). And the
Arguments column is there reference a specic control.
Window Control Action Arguments
Word Menu File, Open
Word Pushbuon Click Folder Name
Word Pushbuon Click Folder Name
Word Pushbuon Click Folder Name
Word Pushbuon Click Open
Word Verify Result
Word Menu File, Close
These tables can be made as needed in order to represent a series of tests. Each table should represent
one complete test. Once youve created your data tables, you simply write a program or a set of scripts
that reads in each step executes the step based on the keyword contained the Action eld, performs
error checking, and logs any relevant information. This program or set of scripts would look similar to
the pseudocode below:
Main Script / Program
Connect to data tables.
Read in row and parse out values.
Pass values to appropriate functions.
Close connection to data tables.
Menu Module
Set focus to window.
Select the menu pad option.
Pushbuon Module
Push the buon based on argument.
Return.
Etc
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
129 of 165 8/12/2014 6:10 PM
From this example you can see that this framework requires very lile code to
generate many test cases. The data tables are used to generate the individual test
cases while the same code is reused over and over again.
Data-Driven Testing
A data-driven framework is where test input and output values are read from data les (ODBC
sources, cvs les, Excel les, DAO objects, ADO objects, and such) and are loaded into variables in
captured or manually coded scripts.
In this framework, variables are used for both input values and output verication values.
Navigation through the program, reading of the data les, and logging of test status and information
are all coded in the test script.
This framework is similar to table-driven testing in that the test case is contained in the data le and
not in the script; the script is just a driver, or delivery mechanism, for the data. Unlike in table-
driven testing, though, the navigation data isnt contained in the table structure.
In data-driven testing, only test data is contained in the data les. This framework tends to reduce
the overall number of scripts you need in order to implement all of your test cases, and it oers the
greatest exibility when it comes to developing workarounds for bugs and performing maintenance.
Much like table-driven testing, data-driven testing requires very lile code to generate many test
cases.
This framework is very easy to implement using most any toolset, and theres a lot of detailed
documentation available with how-tos and examples online.
Hybrid Test Automation
It is a combination of all of the above techniques, pulling from their strengths and trying to mitigate
their weaknesses.
A hybrid test automation framework is what most frameworks evolve into over time and multiple
projects. You can implement modularity by nesting test scripts and using the library les (or objects)
to implement functions, procedures, or methods.
You can implement whichever data-driven technique you choose and to the extent you nd it useful.
The trick is to use the best framework(s) for the job and the only way to gure that out is to jump in
and start using them!
QTP Not just for GUI anymore
19 MAY 2011 Leave a comment
by vsprasad2k in Uncategorized Tags: QTP
QTP Not just for GUI anymore (hp://qtpchallenge.les.wordpress.com/2011/05/qtp-not-just-for-
gui-anymore.ppt)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
130 of 165 8/12/2014 6:10 PM
Hello world!
19 MAY 2011 1 Comment
by vsprasad2k in Uncategorized
Welcome to WordPress.com (hp://wordpress.com/). After you read this, you should delete and write
your own post, with a new title above. Or hit Add New (/wp-admin/post-new.php) on the left (of the
admin dashboard (/wp-admin)) to start a fresh post.
Here (hp://learn.wordpress.com/) are some suggestions for your rst post.
You can nd new ideas for what to blog about by reading the Daily Post
(hp://dailypost.wordpress.com/).
1.
Add PressThis (/wp-admin/tools.php) to your browser. It creates a new blog post for you about any
interesting page you read on the web.
2.
Make some changes to this page (/wp-admin/post.php?post=1&action=edit), and then hit preview on
the right. You can alway preview any post or edit you before you share it to the world.
3.
What are Component, Distributed Component, Automation
and Document Object Models
22 APR 2011 Leave a comment
by vsprasad2k in COM DCOM AOM, QTP, QTP Tricks Tags: AOM, COM, DCOM
Component Object Model
Microsoft COM (Component Object Model) technology in the Microsoft Windows-family of Operating
Systems enables software components to communicate. COM is used by developers to create re-usable
software components, link components together to build applications, and take advantage of Windows
services. The family of COM technologies includes COM+, Distributed COM (DCOM) and ActiveX
Controls.
COM is used to give structured software architecture. COM objects are discrete components,
each with a unique identity, which expose interfaces that allow applications and other components to
access their features. COM objects are more versatile than Win32 DLLs because they are completely
language-independent, have built-in interprocess communications capability, and easily t into an
object-oriented program design.
COM is used in applications such as the Microsoft Oce Family of products. For example COM OLE
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
131 of 165 8/12/2014 6:10 PM
technology allows Word documents to dynamically link to data in Excel spreadsheets and COM
Automation allows users to build scripts in their applications to perform repetitive tasks or control one
application from another.

Distributed Component Object Model
Distributed Component Object Model is an extension of the Component Object Model (COM) that
allows COM components to communicate across network boundaries. Traditional COM components
can only perform interprocess communication across process boundaries on the same machine. DCOM
uses the RPC mechanism to transparently send and receive information between COM components (i.e.,
clients and servers) on the same network.

Automation Object Model
An object model is a structural representation of software objects (classes) that comprise the
implementation of a system or application. An object model denes a set of classes and interfaces,
together with their properties, methods and events, and their relationships.
These Object Models are developed based on COM technology. The QTP Automation Object Model will
give structural representation of QTP classes. Using this we can access QTP options from any other
applications by using a scripting or programming language. An Object Model will give a facility to
control the functionality of an application programmatically.
QTP Automation Object Model developed based on COM and DCOM. We can automate QTP operations
by writing VB scripts. It is possible because of COM. We can run our QTP scripts on a remote machine
which is in the network. It is possible because of DCOM. To know how to run QTP Scripts on a remote
machine follow this path
Go to QTP HELP by pressing F1 in QTP QuickTest Advanced References QuickTest Professional
Automation Object Model Introduction Learning the Basic Elements of a QuickTest
Automation Running Automation Scripts on a Remote Computer

Document Object Model
Document Object Model (DOM), a programming interface developed by the World Wide Web
Consortium (W3C) to create and modify HTML pages and XML documents.
With the Document Object Model, programmers can create and build documents, navigate their
structure, and add, modify, or delete elements and content. Anything found in an HTML
or XML document can be accessed, changed, deleted, or added using the Document Object Model. The
Document Object Model can be used with any programming or scripting languages.
How DOM is useful for Automation Testers?
DOM is useful when working with web applications. We go for DOM to access internal properties or
methods of a web application. .Object property is used to access internal properties or methods. To see
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
132 of 165 8/12/2014 6:10 PM
available internal methods and properties, go to Object Spy point to any web object select Runtime
object properties radio buon
For QTP 10 select Native Properties Radio buon

(hps://v9jjsg.bay.livelestore.com
/y1mUU4qLXxQqy6L7nQkVoQvApoCHeKe3wHAq5GMC43KGGsi_Boh36HkOkAVLvmhAZld5QvFgk
3DABPUgqRpJ3c19ikj96FqBVsdxtx8d8gjlTwh3ZK0BGEeB2fWptA12kum0eSNc9VkCt-QC2Nc4CFKGQ
/comdcom.bmp)
Below code is to get internal property or to access internal method of a web edit
Msgbox Browser(Google).Page(Google).webedit(q).object.value
Browser(Google).Page(Google).webedit(q).object.focus

Focus is a method and Value is a property for webedit.
Object is a property for every QTP web object to access internal properties or methods.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
133 of 165 8/12/2014 6:10 PM
QTP Unable to Recognize Object
15 APR 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
QTP Unable to Recognize Object
1. Check the loaded add-ins:
Its prey basic, but be sure you have the correct add-ins selected. If QTP is only recognizing your
objects as standard WinObject this may be a sign that you need to use an add-in. Sometimes QTPs
Display Add-in Manager on start-up option, under ToolsOptionsGeneral may not be selected. This
seing may cause you to start QTP on a machine and mistakenly assume that all of the correct add-ins
have been chosen. Double-check by opening your script and selecting FileSeings under Properties
Associated add-ins: verifying that all the needed add-ins are listed. Also make sure QTP is started
before the application under test. QTP will sometimes not recognize a web application if the browser
was opened before QTP.
(hp://www.joecolantonio.com/wp-content/uploads/2010/08
/QTP_General2.jpg) (hp://www.joecolantonio.com
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
134 of 165 8/12/2014 6:10 PM
/wp-content/uploads/2010/08/QTP_Properties.jpg)
2. HPs Knowledge base:
Research the issue. If your add-ins are ne, the next step is to search theHPs Knowledge base. Again,
this may seem obvious, but a surprising number of people fail to do this. Theres nothing worse than
spending hours on a script only to discover later that there is a patch (for example see patch that
resolves some QTP 11 object issues) (hp://www.joecolantonio.com/?p=205) available or a posted
solution that will solve the problem. Im sometimes hailed as an automation genius by xing something
that an engineer may have been struggling with for days, based on information I found in the KB. Often,
even after I tell the engineer how I solved the issue, they still dont check the KB the next time they have
a problem. Do me a favor dont be that guy (or gal)! Check the KB. (If nothing is found in the KB,
another great resource to check is SQAForums (hp://www.sqaforums.com/).
3. Using .Object:
Look at all the available objects operations (both the identication properties and native properties
methods). Youll be surprised what youll nd lurking around in an objects properties that may help to
automate it. Using .Object try as many operations as possibleeven ones that may not seem remotely
relevant to the action you want to perform. For example: I was having a problem recognizing text on an
applications custom .NET grid. After spying on the object and trying several dierent methods that
sounded promising, I ended up trying an odd one, called GetViewStyleInfo, and surprisingly it worked!
(hp://www.joecolantonio.com/wp-content/uploads/2010/08
/GetViewStyleInfo1.gif)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
135 of 165 8/12/2014 6:10 PM
(hp://www.joecolantonio.com/wp-content/uploads/2010/08
/GetViewStyle_PRINTINFO.gif)
4. Try GetVisibleText:
Sometimes QTP does not recognize text in an object using the GetROProperty(text) method. As a last
resort, try using the GetVisibleText, GetTextLocation and Type methods. These methods really helped
me automate some old proprietary controls. Using a combination of QTPs TYPE method and
GetTextLocation, I created a very reliable rich edit box object function. For example:
(hp://www.joecolantonio.com/wp-content/uploads/2010/08
/RichEditBox.gif)
? (hp://www.joecolantonio.com/2010/08/12/quicktest-object-recognition/#)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
136 of 165 8/12/2014 6:10 PM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
RichEditBoxICW "0","ENTER","=>","T","From date:"
wait 1
RichEditBoxICW "0","ENTER","Through","T^20","Through date:"
wait 1
RichEditBoxICW "0","ENTER","No=>","N","Do you want to queue this activity?"
'***********************************
'* RICHEDITBOX
'**********************************
'************************
'* ICW
'* @Documentation Used to perform valid actions on RichEdit objects.
'************************
Function RichEditBoxICW(index,action,lineText,valueToEnter,comment)

On Error Resume Next

'*****************************************
' SET OR PATH BASED ON ENV
'*****************************************
set strICWPath = Browser("CF").Page("CF").Frame("WorkSpace").SwfObject("IEController")
strParse = strings("PARSE",valueToEnter,"LEFT","","") 'this would return False string
does not contain ^

Select Case UCASE(action)
Case "ENTER"
intXY = getTextXY(lineText)
arrXY = Split(intXY,"^")
strICWPath.WinObject("regexpwndclass:=RichEdit20A").Click arrXY(0),arrXY(1)

If strParse = "False" Then
Reporter.Filter = rfEnableAll
strICWPath.WinObject("regexpwndclass:=RichEdit20A").Type micRight
strICWPath.WinObject("regexpwndclass:=RichEdit20A").Type valueToEnter
strICWPath.WinObject("regexpwndclass:=RichEdit20A").Type micReturn
strReportMsg = "ENTERED ->" & valueToEnter
ELSE
strEnterValue = geString("PARSE",strValueToEnter,"LEFT","","")'Get Value to Enter
strRightCount = geString("PARSE",strValueToEnter,"RIGHT","","")'Get # of right
keys to press before entering text

for nTabs = 1 to strRightCount
strICWPath.WinObject("regexpwndclass:=RichEdit20A").Type micRight
next

strICWPath.WinObject("regexpwndclass:=RichEdit20A").Type strEnterValue
strICWPath.WinObject("regexpwndclass:=RichEdit20A").Type micReturn

strReportMsg = "ENTERED ->" & strEnterValue
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
137 of 165 8/12/2014 6:10 PM
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
end select
End Function
'---------------------------------------------------------
'@Function Name: getTextXY
'@Documentation Return X and Y coordinates of text
'@Parameters: The text to find
'@Created By: Joe Colantonio
'@Return Values: X & Y coord separated by a ^
'@Example: intXY = getTextXY(strLineText)
'-------------------------------------------------------------
Function getTextXY(strTextToFindXYFor)

set strICWPath = Browser("CF").Page("CF").Frame("WorkSpace").SwfObject("IEController")

l = -1
t = -1
r = -1
b = -1
rc =
strICWPath.WinObject("regexpwndclass:=RichEdit20A").GetTextLocation(strTextToFindXYFor,
l, t, r, b)

getTextXY = r & "^" & t

End function
5. Developers are your friend:
The applications developers can help you. Ask your developers to expose a method or add a property
that will make automation easier. But before you ask make sure youve exhausted all the above
suggestions. Developers can be a tough bunch, and you really dont want to annoy them with things
you could have resolved on your own. I work with some awesome programmers, and as long as Im
able to clearly explain to them what I need and why, they never hesitate to help.
6. Make sure there is not a patch that will help.
Sometimes there are known issues with object recognition that only a QTP patch will resolve. Also new
patches sometime include support for newer version of AUT like .NET or Browsers.
For an updated list of all patches available for QTP 11 check out the Patches section in my article:QTP 11
Support Matrix with Patch Updates (hp://www.joecolantonio.com/?p=382)

History of Quick Test Professional
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
138 of 165 8/12/2014 6:10 PM
05 JAN 2011 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
QTP 5.5v 2002
QTP 6.5 v & 7.6 (2003 -2004)
QTP8.0 & 8.2 2005
QTP9.0 2008
QTP 9.2 & 9.5 2009
QTP 10 2009
QTP 11 2010
Close browsers except QC before end script execution
24 DEC 2010 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, QTP VBScript
SystemUtil.Run taskmgr,,C:\,
Dialog(text:=Windows Task Manager).WinTab(nativeclass:=SysTabControl32).Select Applications
AllItems= Dialog(text:=Windows Task Manager).WinListView(nativeclass:=SysListView32
).GetContent
Arr = Split(AllItems, VbLf)
For i = 0 to UBound(Arr)
title = Arr(i)
If Instr(title, Microsoft Internet Explorer) <> 0 Then
If InStr (title, Quality Center) = 0 Then
SystemUtil.CloseProcessByWndTitle title
Wait 1
End If
End If
Next
Dialog(text:=Windows Task Manager).Close
****************************************Alternatively***************************************************
Set Obj = Description.Create
Obj(micclass).Value = Browser
Set BrowserCollection = Desktop.ChildObjects(Obj)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
139 of 165 8/12/2014 6:10 PM
For i = BrowserCollection.Count-1 To 0 Step -1
If Instr(1,BrowserCollection(i).GetRoProperty(Name),Mercury Quality Center)= 0 Then
BrowserCollection(i).Close
End If
Next
Set Obj = Nothing
Difference between Error Handling & Recovery Scenario
24 NOV 2010 Leave a comment
by vsprasad2k in challenges, QTP
Recovery Scenario:
When executing scripts we may get some Unexpected errors.To recover the test and continue running
script from these unexpected errors we use Recovery Scenarios.
What happens in Recovery Scenarios?
A recovery scenario consists of the following:
Trigger Event:
The event that interrupts your run session. For example a window that may pop up on screen.
Recovery Operations:
The operations to perform to enable QTP to continue running the test after the trigger event interrupts
the run session. For example, clicking an OK buon in a pop-up window.
Post-Recovery Test Run Option:
The instructions on how QTP should proceed after the recovery operations have been performed, and
from which point in the test QTP should continue. For example, you may want to restart a test from the
beginning, or skip a step entirely and continue with the next step in the test. Recovery scenarios are
saved in recovery scenario les having the extension .qrs. A recovery scenario le is a logical collection
of recovery scenarios, grouped according to our specic requirements.
Recovery scenario manger can handle following four events:
1. Pop-up window: To handle unwanted pop ups.
2. Object state: To handle object related errors at runtime.
3. Test run error: To handle vb script statement errors at runtime.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
140 of 165 8/12/2014 6:10 PM
4. Application crash: To handle crashed applications at runtime.
1.Recovery Scenario for Popup Window:
Steps to follow to handle unwanted popups:
Trigger Event Steps:
Resources Menu >Recovery Scenario Manager >New >Next >Select Popup Window as Trigger
event >Next >Click on Hand Icon >Show unwanted window with Hand icon >Next >Next
>(Continue below mentioned steps)
Recovery Operations steps:
Select function call as Recovery Operation >Next {Open Notepad >Save empty le with .vbs
extension} >Browse the .vbs e path >Next >Uncheck Add another Recovery Operation >Next
>(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
Select Post-Recovery Test Run Option {Repeat current step and continue, Proceed to Next step, Proceed
to Next Action, Proceed to next test iteration, Restart current test run, Stop the Test Run} >Next >Enter
Scenario Name >Next >Select Option > Finish >Save the scenario with .qrs >Record required
Recovery Operation {Click ok, Click Cancel} take the script into function >Save the library le >Click
Run
2.Recovery Scenario for Object State:
Steps to follow to check Property values of an object in the application match specied values. User can
specify property values for each object in the hierarchy.
Trigger Event steps:
Resources Menu > Recovery Scenario Manager > New > Next > Select Object state Window as
Trigger event > Next > Click on Hand Icon > Show object with and icon > Next > Next>select
object property with value (enabled ,false)>click next > (Continue below mentioned steps)
Recovery Operations steps:
Select function call as Recovery Operation > Next {Open Notepad > Save empty le with .vbs
extension} > Browse the .vbs e path > Next > Uncheck Add another Recovery Operation > Next
>(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
Select Post-Recovery Test Run Option {Repeat current step and continue, Proceed to Next step, Proceed
to Next Action, Proceed to next test iteration, Restart current test run, Stop the Test Run} > Next> Enter
Scenario Name > Next > Select Option >Finish > Save the scenario with .qrs > Record required
Recovery Operation {Click ok, Click Cancel} take the script into function > Save the library le > Click
Run
3.Recovery Scenario for Test Run Error:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
141 of 165 8/12/2014 6:10 PM
Steps to follow to check if test does not run successfully then Test Run Error can be raised.
Trigger Event steps:
Resources Menu >Recovery Scenario Manager >New >Next >Select Testrunerror Window as
Trigger event >Next >select any error o >Next >Next >(Continue below mentioned steps)
Recovery Operations steps:
Select function call as Recovery Operation >Next {Open Notepad >Save empty le with .vbs
extension} >Browse the .vbs e path >Next >Uncheck Add another Recovery Operation >Next
>(Continue below mentioned steps)
Post-Recovery Test Run Option Steps:
Select Post-Recovery Test Run Option {Repeat current step and continue, Proceed to Next step, Proceed
to Next Action, Proceed to next test iteration, Restart current test run, Stop the Test Run} >Next >Enter
Scenario Name >Next >Select Option > Finish >Save the scenario with .qrs >Record required
Recovery Operation {Click ok, Click Cancel} take the script into function >Save the library le >Click
Run
4.Recovery Scenario for Application Crash:
Steps to follow to check application failure during Test Run.
Trigger Event steps:
Resources Menu > Recovery Scenario Manager> Click New> Click Next >Select Application Crash
as Trigger event>Next >Select selected executable application>Next > (Continue below mentioned
steps)
Recovery Operations and Post-Recovery Test Run Option Steps:
Select Recovery Operation {Keyboard, Mouse Operation,Close Application Process, function Call,
Restart, Microsoft Windows} >Next >If you want to check Add another operation else uncheck>Next
>Next >Enter Scenario Name >Next>Select Option >Finish >Close >Save the scenario with .qrs
When to use Error handling(on error resume next) vs Recovery Scenarios ?
If you can predict that a certain event may happen at a specic point in your test or component, it is
recommended to handle that event directly within your test or component by adding steps such as If
statements or optional steps or on error resume next, rather than depending on a recovery scenario.
Using Recovery Scenarios may result in unusually slow performance of your tests.They are designed to
handle a more generic set of unpredictable events which CANNOT be handled programmatically.
Example:
A recovery scenario can handle a printer error by clicking the default buon in the Printer Error
message box.You cannot handle this error directly in your test, since you cannot know at what point the
network will return the printer error. You could try to handle this event in your test by adding an If
statement immediately after the step that sent a le to the printer, but if the network takes time to return
the printer error, your test may have progressed several steps before the error is displayed. Therefore,
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
142 of 165 8/12/2014 6:10 PM
for this type of event,only a recovery scenario can handle it.
On error Statements
Following are error statements :
1. On Error Resume Next
2. On Error Go to 0
3. err.number
4. err.description
On Error Resume Next:
On Error Resume Next statement enables the Error handling in the code.If there is error in the code On
error Resume Next ignores it and continue with next line of code.
On Error Go to 0:
On error got to 0 statement disables error handling we have previiously enabled it by using On Error
resume Next.
err.number and err.description:
Provides the error number and the description of the error
Example:
Call the function to divide
call division
Function division()
on error resume next
divide by zero
z=40/0
Report the error occured. You can see the error number and description in result summary
If Err.number <> 0 then
Reporter.ReportEvent micWarning,Error Occured,Error number is & err.number & and
description is : & err.description
disables error handling
on error goto 0
End if
End function
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
143 of 165 8/12/2014 6:10 PM
Run VB Script Code without using QTP
06 SEP 2010 Leave a comment
by vsprasad2k in Uncategorized
1. Just copy n paste below code to new notepad
To extract a number from alphanumeric text string
Dim mystring, myLength
mystring = This is QTP Challenges Website 4 Experts
myLength = Len(mystring)
For i = 1 To myLength
If Asc(Mid(mystring, i, 1)) <> 32 Then
If Asc(Mid(mystring, i, 1)) >= 48 And Asc(Mid(mystring, i, 1)) <= 57 Then
myNumber = myNumber & Mid(mystring, i, 1)
End If
Else
msgbox(no numeric)
End If
Next
msgbox(myNumber)
2. Save le as test.vbs (with double quotes)
3. Itll display like this on your hard drive..
(hp://qtpchallenge.les.wordpress.com/2011/09/vbs1.jpg?w=79)
4. Now close the le and double click on the le icon.
and its done!!
Please note that itll work only if you dont have any object in your script.
How can you quickly sort given VBScript array
25 APR 2010 Leave a comment
by vsprasad2k in challenges, QTP, QTP VBScript Tags: QTP VBScript
You could simply write your own sort algorithm (like a bubble sort) and encapsulate it in a function,
however theres another way thats faster, while remaining very exible. The key is using the JScript
arrays highly ecient sort method. Since VBScript and JScript arrays arent directly interchangeable, we
have to incur some overhead passing them back and forth. But the overhead is usually worth it.
:)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
144 of 165 8/12/2014 6:10 PM
<%
for i = UBound(arrShort) - 1 To 0 Step -1
for j= 0 to i
if arrShort(j)>arrShort(j+1) then
temp=arrShort(j+1)
arrShort(j+1)=arrShort(j)
arrShort(j)=temp
end if
next
next %>
First we dene a JScript function that accepts a VBArray (a safeArray type), changes it to a JScript array
and sorts it:
<script language=JScript runat=server>
function SortVBArray(arrVBArray) {
return arrVBArray.toArray().sort().join('\b');
}
</script>
Thats all there is to, it but heres the breakdown of the one line of code:
return Tells the function to return whatever comes to the right of it as the output of the function.
arrVBArray.toArray() Calls the toArray() method of the VBArray to convert it to a JScript array
(this method is only available in JScript).
.sort() Since the expression to the left of this code evaluates to a Jscript array, we can now call the
sort() method of it, to perform a case-sensitive ascending sort.
.join('\b'); This now joins the JScript array into a delimited string. The \b is a special non-printable
character that is used as the delimiter because it will (almost) never appear in a string unlike other
potential delmiters such as the comma. This is how it will be passed back to VBScript.
Next you need a VBScript function to nish o what this function couldnt do in JScript, convert the
output to a VBScript array. It looks like this:
<%
Function SortArray(arrInput)
SortArray = Split(SortVBArray(arrInput), Chr(8))
End Function
%>
Again only one line, this function uses the VBScript Split function to reconstitue the VBArray, now in
sorted form. If you just wanted a sorted delimited string, you could call the SortVBArray() function
directly.
How to Reduce Test Execution Time in QTP
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
145 of 165 8/12/2014 6:10 PM
24 APR 2010 Leave a comment
by vsprasad2k in QTP, QTP ADODB, QTP Tricks, QTP VBScript
QTP is used mainly for Regression Testing. The idea behind it is to reduce human errors and also to
overcome the keying process. There is one more advantage of using QTP and that is to reduce execution
time. If we use QTP eectively we can reduce the test execution time drastically. While writing the
script, the time aspect has to be considered; otherwise we will nally end up with a script which will
take the same time if it is done manually. This document speaks about how to write script eectively to
reduce the execution time.
Usual Approach
Usually a new script is created for each scenario. Few create a framework supported script. There are
dierent ways of creating framework supported script. One way is to create a separate Data table, Object
repository for each scenario but will have one script to execute the entire scenario. This script can be
used to run on any application. But a data table and object repository is necessary for the script to
execute. Also we need to import data table and object for each scenario, which will consume time. In
addition it might require some conguration changes.
We can also create a separate script for each scenario and in order to reduce the execution time, we can
use the QTP Batch Process. Batch Process can be used to reduce execution time. The only disadvantage
here is, the result cant be stored as we wish, by default it gets stored in the script folder.
Disadvantages of Normal Process:
Lot of human work is required even after automating the process.
Test execution time is almost the same as manual execution.
May need to make conguration changes (depends on the way we write the script)
For a small change in the UI we need to update each and every script to incorporate the change.
Not possible to do a complete regression in time critical projects.
New Approach
This approach is based on the Data- driven Framework. The test data drives the business scenario. The
script might get complex if not planned properly. But a planned process will reduce the execution time
drastically.
Step 1
Proper planning needs to be done before starting to write the script. Get in touch with the business folks
to know the possible business scenarios. A clear idea of the business scenario is required to write the
data-driven script. Finalize how many Actions/Reusable Actions are required to achieve the complete
business ow. Try to create Actions based on the business functionality, dont go by page wise (for web
apps),
Example: For an Insurance Claims system, we can create the following Actions, based on the
Functionality, Login, Loss Details, Vehicle Details, Driver Details, Coverage Details and Payments and
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
146 of 165 8/12/2014 6:10 PM
so on.
Step 2
Keep the objects common for all scenarios in one Action. Split the business ow in to dierent Actions
based on the functionality. This can be accomplished by using conditional statements. Wherever
required parameterize the object value. Care should be taken while parameterzing, since the object in
the current Action cannot be accessed from any other Action. So objects value which is used across
dierent Actions has to be dened in the Global sheet.
Example: Policy Number might be required to execute all Actions available in the script, so while
Parameterizing we should use the Global Sheet. Also when there is no payment associated with the
Claim, we should not execute the Payment Action, which is accomplished by a Conditional check as
mentioned below,
If DataTable (Payment, dtLocalSheet) <> Then
< Payment steps
- >
End If
Step 3
First complete the end to end script for one business functionality. Then integrate the new functionality
script to the existing one. Execute and test your integrated script, to make sure that each business ow is
executed. Depending on the complexity of the application, lot of conditional statements may be required
to be incorporated in the script. All the conditional check should be based on the data table values. Thus
we can say that the data drives the business ow.
Example:
If DataTable (Coverage, dtLocalSheet) = COLL Then
< Steps >
ElseIf DataTable (Coverage, dtLocalSheet) = PD Then
< Steps >
-
-
End If
Step 4
Finally you will end up with a script which can be used to test the complete functionality of the
application. Try to run the script to execute all the business scenarios. One or two errors might occur
while executing a huge number of scenarios. Create Recovery scenarios to over come the unexpected
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
147 of 165 8/12/2014 6:10 PM
errors.
Example: At times, pop ups for Informational message might be displayed in the application, which
need to be answered to proceed. A Recovery scenario can be created in QTP to answer the pop ups. So
whenever pop up is displayed the recovery scenario will be invoked.
If the application under test has a Login page, we could skip login for each scenario. Only for the rst
time you need to login to the application, thereafter for the forthcoming scenarios we dont have to
login, which would save time. Dont forget to create a recovery scenario for login, which should be
triggered whenever there is an error.
Sample Script:
Environment (FirstIteration) =yes
Environment (TestStatus) =unknown
If Environment (FirstIteration) = yes or Environment (TestStatus) =failed Then
Set IE = CreateObject (InternetExplorer.Application)
IE.Visible = true
URL = DataTable (url, dtGlobalSheet)
IE.Navigate URL
Browser (Browser).Page (Page).Sync
If Environment (TestStatus) = failed or Environment (TestStatus) =unknown Then
If Browser (Browser).Page (Page).link (Logout).Exist ([0]) Then
Browser (Browser).Page (Page).link (Logout).Click
Browser (Browser).Page (Page).Sync
End If
End If
Browser (Browser).Page (Page).Link (Login).Click
Browser (Browser).Page (Login).sync
Do while Browser (Browser).Page (Login).WebBuon (Log In).Exist (1)
Browser (Browser).Page (Login).WebEdit (j_username).Set xxxxx
Browser (Browser).Page (Login).WebEdit (j_password).Set yyyyy
Browser (Browser).Page (Login).WebBuon (Log In).Click
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
148 of 165 8/12/2014 6:10 PM
Loop
Set FirstIteration as no and TestStatus as unknown
Environment (FirstIteration) =no
Environment (TestStatus) =unknown
Else
< Proceed with the application ow >
End If
Advantages of Data Driven Approach
Reduces the execution time drastically.
Can be executed without human intervention.
The script can be executed during the night hours, since there is no need for the resource to run the
script. Thus saving the normal works hours.
Also we could schedule the run process, so that the execution will start at the scheduled time.
Normally regression test will be performed on the last build before release. If we get any errors it
becomes dicult to x it at the last minute. But if we use the Data driven script we could do a
regression test on each build from construction to deployment, to ensure that all existing
functionalities are not broken and to avoid the last minute surprises. Also if any bug is identied we
will have enough time to x it. Also Debugging becomes easier.
Very useful for testing application developed using Agile Methodology which will have frequent
releases.
QTP Start-up Tips
06 JAN 2010 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
1. Load only required Add-inns i.e. if working on window based application, do not load Web, Java etc.
More then 3 Add-inns may slow down QTP.
2. Make sure that MS Script Debugger is installed on machine. Although its part of QTP installation but
if your Internet connectivity is not proper while installing QTP, it might not be installed. It enables you
to debug scripts and using breakpoints.
3. Open QTP rst and then application. If application is already open, close it. Open QTP and then open
application. (not true in few specic cases)
4. Check record seings..
a) Go to Test >> Record and Run Seings.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
149 of 165 8/12/2014 6:10 PM
b) Select the Windows Applications tab.
c) Select the Record and run test on any open Windows-based application option.
5. Close all browsers before start recording.
6. Clear AutoComplete option in IE for user names and passwords
a) Tools >> Internet Options >> Content tab >> AutoComplete >> Seings
b) Clear Usernames and passwords on form checkbox
7. DataTable, Function Library and Object Repository are most common resources used in QTP. Make
sure all these aached/managed properly.
8. By default, result is automatically open on completion of test execution. Close automatic result if you
dont specically require this.
a) Go to >> Tools >> Option >> Run
b) Clear Display Results after Iteration checkbox
You can still open results whenever you want by clicking View >> Results.
9. Try to get good RAM (at least 2GB) on the machine. Beer RAM you have, faster your QTP will be.
10. Clear temporary les frequently (once in a week).
a) Restart Machine
b) Go to Start >> Run >> type %temp% >> Enter
c) Delete all les and folders
QTP identifies Web objects as Window objects, doesnt
record properly
06 JAN 2010 Leave a comment
by vsprasad2k in Uncategorized
Open QTP >> go to Automation >> Record and Run Seings >> select Windows Applications tab >>
Select the Record and run test on any open Windows-based application option. >> Click Apply.
Try if problem is solved. If problem still exists, check following seings in Internet Explorer (IE)-
1. Make sure to disable Protected mode in IE.
Go to Tools >> Internet Options >> Security tab >> uncheck Enable Protected Mode >> Click Apply >>
restart Internet Explorer.
2. Disable Tabbed Browsing (applicable in IE8 and laer)
Go to Tools >> Internet Options >> General Tab >> Click on Seing in Tabs section >> unchecked Enable
Tabbed Browsing checkbox >> Click OK >> Restart IE
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
150 of 165 8/12/2014 6:10 PM
Working on Regular Expressions in QTP
20 DEC 2009 Leave a comment
by vsprasad2k in QTP
Regular Expression:
Regular Expressions enable Quick Test to identify objects and text strings with varying values.Regular
expressions are
used when the objects value is dynamically changed.
A regular expression is a string that species a complex search phrase. By using special characters
such as a period (.),
asterisk (*), caret (^), and brackets ([ ]), etc. you dene the conditions of the search.
Steps to Specify Regular Expressions for an object in Object Repository:
1. Go to Object Repository. Navigation: Resources>>Object Repository.
2. Select the Object which you want to specify regular expression.
3. In the right side you can observe properties of that object.
4. Select the property which you want to specify regular expression.
5. Click on the property value of that property and the property value is editable. There is a congure
buon appeared with the
symbol <#>
6. Click on the congure buon or use Ctrl+F11 to open congure window.
7. Select Regular Expression check box.
a. If the property value is having any special characters then QTP will display a dialog with asking
Do you want to add the backslash (\) before each special character in order to treat it literally?
b. If you click on yes QTP will automatically gives the backslash before every special character. So that
the special
characters will be treated as literal.
8. Now specify the regular expression in constant edit box.
9. Click on OK.
10. Observe that a symbol A.* is added in property eld. This means, that property is using regular
expression.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
151 of 165 8/12/2014 6:10 PM
11. Highlight the object in application to ensure that the provided regular expression is working ne.
In Dynamic descriptive programming we create a descriptive object using description.create.
While specifying properties we can give regular expressions. By default the properties will be treated as
regular expression when you added to description object.
Set oDescription=Description.Create
oDescription(micclass).value= Browser
oDescription(openurl).value= hp://www.google.co.in&#8221 (hp://www.google.co.in&#8221);
Here in this URL property there are three dots (.) which can be treated as regular expressions. These
dots will work as regular expressions because by default the property values will be treated as regular
expressions.
There is a property called regularexpression for description object which is used to set the property
values to work as regular expressions or as a literal string values.
In the Above example, set the regularexpression property to false to treat hp://www.google.co.in
(hp://www.google.co.in/) as a literal string.
Set oDescription=Description.Create
oDescription(micclass).value= Browser
oDescription(openurl).value= hp://www.google.co.in&#8221 (hp://www.google.co.in&#8221);
oDescription(openurl).regularexpression = False
oDescription(openurl).regularexpression = False
Note:
You can always use forward slash symbol (\) before every special character to treat a property value as
literal character.
Use of Regular Expression in QTP
We can use regular expressions in QTP when
1. Dening Properties of an Object
2. Verifying data using check points
3. Parameterize an object property or check point
Note:
You can use regular expressions only for values of type string.
By default all properties which you pass from object property are strings / Constants.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
152 of 165 8/12/2014 6:10 PM
When using action parameters to parameterize a check point or an object repository, those action
parameters data type
must be string type. If you specify any other data type, that will not be treated as regular expression.
We can assign property values to variables in QTP when using descriptive programming. When
assigning regular
expression to any variable make sure that regular expression is in string format.
When any special character in a regular expression is preceded by a backslash (\), QuickTest searches
for the literal
character.
If your searching for a character * in a string, then you need to give the paern as \*
QTP Tips and Tricks
06 DEC 2009 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks
Data Table
Two Types of data tables
Global data sheet: Accessible to all the actions
Local data sheet: Accessible to the associated action only
Usage:
DataTable(Column Name,dtGlobalSheet) for Global data sheet
DataTable(Column Name,dtLocalSheet) for Local data sheet
If we change any thing in the Data Table at Run-Time the data is changed only in the run-time data
table. The run-time data table is accessible only
through then test result. The run-time data table can also be exported using DataTable.Export or
DataTable.ExportSheet
How can i save the changes to my DataTable in the test itself?
Well QTP does not allow anything for saving the run time changes to the actual data sheet. The only
work around is to share the
spreadsheet and then access it using the Excel COM Apis.
How can i check if a parameter exists in DataTable or not?
The best way would be to use the below code:
code:
on error resume next
val=DataTable(ParamName,dtGlobalSheet)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
153 of 165 8/12/2014 6:10 PM
if err.number<> 0 then
Parameter does not exist
else
Parameter exists
end if
How can i make some rows colored in the data table?
Well you cant do it normally but you can use Excel COM APIs do the same. Below code will explain
some expects of Excel COM APIs
code:
Set xlApp=Createobject(Excel.Application)
set xlWorkBook=xlApp.workbooks.add
set xlWorkSheet=xlWorkbook.worksheet.add
xlWorkSheet.Range(A1:B10).interior.colorindex = 34 Change the color of the cells
xlWorkSheet.Range(A1:A10).value=text Will set values of all 10 rows to text
xlWorkSheet.Cells(1,1).value=Text Will set the value of rst row and rst col
rowsCount=xlWorkSheet.Evaluate(COUNTA(A:A)) Will count the # of rows which have non blank
value in the column A
colsCount=xlWorkSheet.Evaluate(COUNTA(1:1)) Will count the # of non blank columns in 1st row
xlWorkbook.SaveAs C:Test.xls
xlWorkBook.Close
Set xlWorkSheet=Nothing
Set xlWorkBook=Nothing
set xlApp=Nothing
SMART Identication
Smart Identication is nothing but an algorithm used by QTP when it is not able to recognize one of the
object. A very generic example as per the
QTP manual would be, A photograph of a 8 year old girl and boy and QTP records identication
properties of that girl when she was 8, now when
both are 10 years old then QTP would not be able to recognize the girl. But there is something that is still
the same, that is there is only one girl in
the photograph. So it kind of PI (Programmed intelligence) not AI.
When should i use SMART Identication?
Something that people dont think about too much. But the thing is that you should disable SI while
creating your test cases. So that you
are able to recognize the objects that are dynamic or inconsistent in their properties. When the script has
been created, the SI should be enabled,
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
154 of 165 8/12/2014 6:10 PM
so that the script does not fail in case of small changes. But the developer of the script should always
check for the test results to verify if the SI
feature was used to identify a object or not. Sometimes SI needs to be disabled for particular objects in
the OR, this is advisable when you use
SetTOProperty to change any of the TO properties of an object and especially ordinal identiers like
index, location and creationtime.
Descriptive Programming
Descriptive programming is nothing but a technique using which operations can be performed on the
AUT object which are not present in
the OR. For more details refer to hp://bondofus.tripod.com/QTP/DP_in_QTP.doc
(hp://bondofus.tripod.com/QTP/DP_in_QTP.doc) (right click and use save as)
Recovery Scenarios
What is a Recovery Scenario?
Recovery scenario gives you an option to take some action for recovering from a fatal error in the test.
The error could range in from
occasional to typical errors. Occasional error would be like Out of paper popup error while printing
something and typical errors would be like
object is disabled or object not found. A test case have more then one scenario associated with it and
also have the priority or order in which it
should be checked.
What does a Recovery Scenario consists of?
Trigger: Trigger is nothing but the cause for initiating the recovery scenario. It could be any popup
window, any test error, particular state
of an object or any application error.
Action: Action denes what needs to be done if scenario has been triggered. It can consist of a
mouse/keyboard event, close application, call a
recovery function dened in library le or restart windows. You can have a series of all the specied
actions.
Post-recovery operation: Basically dened what need to be done after the recovery action has been
taken. It could be to repeat the step, move
to next step etc.
When to use a Recovery Scenario and when to us on error resume next?
Recovery scenarios are used when you cannot predict at what step the error can occur or when you
know that error wont occur in your
QTP script but could occur in the world outside QTP, again the example would be out of paper, as
this error is caused by printer device driver. On
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
155 of 165 8/12/2014 6:10 PM
error resume next should be used when you know if an error is expected and dont want to raise it, you
may want to have dierent actions
depending upon the error that occurred. Use err.number & err.description to get more details about the
error.
Library Files or VBScript Files
How do we associate a library le with a test ?
Library les are les containing normal VBScript code. The le can contain function, sub procedure,
classes etc. You can also use executele
function to include a le at run-time also. To associate a library le with your script go to
Test->Seings and add your library le to resources
tab.
When to associate a library le with a test and when to use execute le?
When we associate a library le with the test, then all the functions within that library are available to all
the actions present in the test. But
when we use Executele function to load a library le, then the function are available in the action that
called executele. By associated a library to
a test we share variables across action (global variables basically), using association also makes it
possible to execute code as soon as the script
runs because while loading the script on startup QTP executes all the code on the global scope. We can
use executele in a library le associated
with the test to load dynamic les and they will be available to all the actions in the test.
Add-ins
Test and Run-time Object
What is the dierence between Test Objects and Run Time Objects ?
Test objects are basic and generic objects that QTP recognize. Run time object means the actual object to
which a test object maps.
Can i change properties of a test object
Yes. You can use SetTOProperty to change the test object properties. It is recommended that you switch
o the Smart Identication for the
object on which you use SetTOProperty function.
Can i change properties of a run time object?
No (but Yes also). You can use GetROProperty(outerText) to get the outerText of a object but there is
no function like SetROProperty to
change this property. But you can use WebElement().object.outerText=Something to change the
property.
Action & Functions
What is the dierence between an Action and a function?
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
156 of 165 8/12/2014 6:10 PM
Action is a thing specic to QTP while functions are a generic thing which is a feature of VB Scripting.
Action can have a object repository
associated with it while a function cant. A function is just lines of code with some/none parameters and
a single return value while an action can
have more than one output parameters.
Where to use function or action?
Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action
only. If the functionality is not about any
automation script i.e. a function like geing a string between to specic characters, now this is
something not specic to QTP and can be done on
pure VB Script, so this should be done in a function and not an action. Code specic to QTP can also be
put into an function using DP. Decision of
using function/action depends on what any one would be comfortable using in a given situation.
Checkpoint & Output value
What is checkpoint?
Checkpoint is basically a point in the test which validates for truthfulness of a specic things in the AUT.
There are dierent types of
checkpoints depending on the type of data that needs to be tested in the AUT. It can be text,
image/bitmap, aributes, XML etc.
Whats the dierence between a checkpoint and output value?
Checkpoint only checks for the specic aribute of an object in AUT while Output value can output
those aributes value to a column in data
table.
How can i check if a checkpoint passes or not?
code:
chk_PassFail = Browser().Page().WebEdit().Check (Checkpoint(Check1))
if chk_PassFail then
MsgBox Check Point passed
else
MsgBox Check Point failed
end if
My test fails due to checkpoint failing, Can i validate a checkpoint without my test failing due to
checpoint failure?
code:
Reporter.Filter = rfDisableAll Disables all the reporting stu
chk_PassFail = Browser().Page().WebEdit().Check (Checkpoint(Check1))
Reporter.Filter = rfEnableAll Enable all the reporting stu
if chk_PassFail then
MsgBox Check Point passed
else
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
157 of 165 8/12/2014 6:10 PM
MsgBox Check Point failed
end if
Environment
How can i import environment from a le on disk
Environment.LoadFromFile C:Env.xml
How can i check if a environment variable exist or not?
When we use Environment(Param1).value then QTP expects the environment variable to be already
dened. But when we use
Environment.value(Param1) then QTP will create a new internal environment variable if it does not
exists already. So to be sure that variable exist
in the environment try using Environment(Param1).value.
How to connect to a database?
code:
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objConnection = CreateObject(ADODB.Connection)
Set objRecordset = CreateObject(ADODB.Recordset)
objConnection.Open DRIVER={Microsoft ODBC for Oracle};UID=;PWD=

objRecordset.CursorLocation = adUseClient
objRecordset.CursorType = adopenstatic
objRecordset.LockType = adlockoptimistic
ObjRecordset.Source=select eld1,eld2 from testTable
ObjRecordset.ActiveConnection=ObjConnection
ObjRecordset.Open This will execute your Query
If ObjRecordset.recordcount>0 then
Field1 = ObjRecordset(Field1).Value
Field2 = ObjRecordset(Field2).Value
End if
Script to upload attachment in QC test lab
06 SEP 2009 Leave a comment
by vsprasad2k in Uncategorized
Dim oCurrentTest,oAachment
Set oCurrentTest = QCUtil.CurrentTest.Aachments
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
158 of 165 8/12/2014 6:10 PM
Set oAachment = oCurrentTest.AddItem(Null)
oAachment.FileName = C:Results.xls
oAachment.Type = 1 oAachment.Post
oAachment.Refresh Set
oAachment =Nothing
Set oCurrentTest =Nothing
How to perform Page Scroll using QTP
06 SEP 2009 Leave a comment
by vsprasad2k in Uncategorized
Syntax:
object .doScroll(Scrollingaction)
Scrolling Actions:
1.Up
2.down
3.pageUp
4.pageDown
5.pageLeft
6.pageRight and many more.
Function Scroll()
Browser(micclass:=Browser).Page(micclass:=Page).Sync
Set oDoc=Browser(micclass:=Browser).Page(micclass:=Page).Object.Body
oDoc.doScroll(pageDown)
Set oDoc=Nothing
End Function
Problem using On Error Resume Next
06 SEP 2009 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, QTP VBScript
Case: Login buon is not visible in AUT
On Error Resume Next
Browser(browser).Page(page).WebEdit(loginname).Set Rajesh
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
159 of 165 8/12/2014 6:10 PM
Browser(browser).Page(page).WebEdit(password).SetSecure mypassword
Browser(browser).Page(page).WebBuon(login).click
On Error GOTO 0
Result : There will be no runtime error and because steps inside the On error resume next are not
optional, it leads to incorrect result.
So do we need to avoid using On error resume next?
No, but remember.. Its useful when you intentionally dont want to let some runtime errors occur
during script execution i.e. any temporary browser specic error or printer error which is not about
AUT (application under test).
Working with DataBase Connections using QTP
06 SEP 2009 Leave a comment
by vsprasad2k in Uncategorized
Connect_DataBase() Creates a new DB connection
Arguments passed to this function -
1. SessionName
2. Connection_String a connection string, for example the connection_string can be
DSN=SQLServer_Source;UID=SA;PWD=xyz123.
Please note that the connection string will vary as per your database details.
Function to connect DataBase:
Function Connect_DataBase(strSessionName, strConnectionstring)
Dim oConnection
on error Resume next
Opening connection
set oConnection = CreateObject(ADODB.Connection)
If Err.Number <> 0 then
DataBase_Connection= Error :- & CStr(Err.Number) & & Err.Description
Err.clear
Exit Function
End If
oConnection.Open connection_string
oConnection.CommandTimeout = 120 modify this value if needed.
If Err.Number <> 0 then
Connect_DataBase= Error := & CStr(Err.Number) & & Err.Description
err.clear
Exit Function
End If
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
160 of 165 8/12/2014 6:10 PM
set sessionName = oConnection
Connect_DataBase = 0
End Function
Function to retrieve data from record set:
Function db_get_eld_value( myrs , rowNum, colNum )
dim curRow
myrs.MoveFirst
count_elds = myrs.elds.count-1
If ( TypeName(colNum)<> String ) and ( count_elds < colNum ) then
db_get_eld_value = -1 requested eld index more than exists in recordset
Else
myrs.Move rowNum
db_get_eld_value = myrs.elds(colNum).Value
End If
End Function
Use the above functions to connect and retrive data from DB:
Con = <name of the session>
SQL=SELECT * FROM Your_Table
con_string=DSN=SQLServer_Source;UID=SA;PWD=xyz123
isConnected = Connect_DataBase (Con , con_string)
Now check if connection is successful. Function will return zero if connection is successful.
If isConnected = 0 then
Execute your SQL statement
set myrs = Con.Execute(SQL)
Retrieve values from the recordset
print val row 0 col 0: & db_get_eld_value( myrs , 0 , 0 )
print val row 0 col 1: & db_get_eld_value( myrs , 0 , 1 )
End If
Con.close
Set Con = Nothing Disconnect database
How to get text of Status Bar from QuickTest Professional
24 MAY 2009 1 Comment
by vsprasad2k in QTP, QTP Tricks
There are two ways:
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
161 of 165 8/12/2014 6:10 PM
Object.StatusText property of Browser object 1.
GetROProperty(text) method of WinStatusBar object 2.
Geing text of Status Bar using Object.StatusText property of Browser objectTo access text of
Status Bar, we use Browsers Object object and its StatusText property.
Browser(bname).Object is a reference to the Internet Explorers DOM object. To be more precise,
its a reference to the Internet Explorers IWebBrowser2 interface.
Using Browser(bname).Object, you can access dierent methods and properties of IE, for example:
1.
# Statement Meaning
1
Browser(bname).Object.GoBack Navigates backward one item in the history list
2 Browser(bname).Object.LocationURL Gets the URL of the page that is currently displayed
3 Browser(bname).Object.StatusText Sets or gets the text in the status bar for the object
4 Browser(bname).Object.ToolBar Sets or gets whether toolbars for the object are visibl
So, our code is simpe enough: 2.
sText = Browser(QTP How to get Status).Object.StatusText
MsgBox sText
sText = Browser(QTP How to get Status).WinStatusBar(msctls_statusbar32
).GetROProperty(text)
MsgBox sText
Working with ADODB connections using QTP
24 MAR 2009 Leave a comment
by vsprasad2k in QTP ADODB Tags: QTP ADODB
How to open a password-protected database.
Example:
Dim FlightNumber
Dim dbexample
Create the conection object.
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
162 of 165 8/12/2014 6:10 PM
Set dbexample = CreateObject(ADODB.Connection)
Set the connection string and open the connection
dbexample.ConnectionString = DBQ=D:\Program Files\Mercury Interactive\WinRunner\samples
\ight\app\ight32.mdb;DefaultDir=D:\Program Files\Mercury Interactive\WinRunner\samples
\ight\app;Driver={Microsoft Access Driver (*.mdb)};DriverId=281;FIL=MS
Access;MaxBuerSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;
UserCommitSync=Yes;
dbexample.Open
or use this method if a DSN entry was created.
dbexample.Open(DSN=Flight32)
ightnumber = 6195
Get the recordset returned from a select query.
Set recordset = dbexample.Execute(SELECT * from Orders WHERE Flight_Number = &
ightnumber)
Display the results of the query.
msgbox recordset.GetString
Close the database connection.
dbexample.Close
Set dbexample = Nothing
If your query returns several columns, you can use the Fields method to retrieve data from specied
columns in the returned record set.
Example:
Connect to the Flight32 database
Set dbexample = CreateObject(ADODB.Connection)
dbexample.Open(DSN=Flight32)
Perform a query
Set recordset = dbexample.Execute(SELECT * from Orders)
Get the values from the Customer_Name column
while (NOT recordset.EOF)
MsgBox recordset.Fields(Customer_Name)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
163 of 165 8/12/2014 6:10 PM
Move to the next value in the record set
recordset.MoveNext
wend
Close the database connection.
dbexample.Close
Set dbexample = Nothing
Message Box closes automatically using windows shell
05 MAR 2009 1 Comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
Dim msg
msg = Message Box automatically close in 5 second
Set oShell = CreateObject(WScript.Shell)
oShell.Popup msg,10, QTP Challenges
In above statement, there are three arguments -
msg the content/string of the message box
10 the time in seconds
QTP Challenges the title of the message box
Working with WMI (Windows Management Infrastructure)
05 FEB 2009 Leave a comment
by vsprasad2k in challenges, QTP, QTP Tricks, Uncategorized
Dim ag, AllProcess, AppToRun
AppToRun = ixplore.exe
Flag = Flase
Set AllProcess = GetObject(winmgmts:)
For Each Process In AllProcess.InstancesOf(Win32_process)
If (Instr ((Process.Name), AppToRun) = 1) Then
Print Internet Explorer is running..
Flag = Ture
Exit For
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
164 of 165 8/12/2014 6:10 PM
End If
Next
If Flag = Flase Then
Print Internet Explorer not is running..
SystemUtil.Run AppToRun
End If
You can do the same for any process/application. You just need to change the value of AppToRun
variable.
Blog at WordPress.com. The Koi Theme.
Follow
Follow QTP Challenges 4 Experts
Powered by WordPress.com
:)
QTP Challenges 4 Experts | Just another WordPress.com site http://qtpchallenge.wordpress.com/
165 of 165 8/12/2014 6:10 PM

Das könnte Ihnen auch gefallen