
Loading ...
We executed the below code in QTP and found that things don’t work the way they are supposed to
Dim RepositoryFrom
Set RepositoryFrom = CreateObject("Mercury.ObjectRepositoryUtil")
RepositoryFrom.Load "C:\KIB\Demo.tsr"
Browser("KIB").Page("KIB").WebEdit("test").Set "Test"
The Browser(”KIB”).Page(”KIB”).WebEdit(”test”) object is present in the demo.tsr file. Another version of the code that does not work is as below
Set RepositoryFrom = CreateObject("Mercury.ObjectRepositoryUtil")
RepositoryFrom.Load "C:\KIB\Demo.tsr"
Set oTestEdit = RepositoryFrom.Load("Browser(""KIB"").Page(""KIB"").WebEdit(""test"")")
oTestEdit.Set "Test"
The code snippets [...]
Register or Login to read the full article...
Tags used -
Error, Issue, load, loaded, Mercury.ObjectRepositoryUtil, Object, Object Repository, ObjectRepositoryUtil, OR, unload

Loading ...
RepositoriesCollection utility object introduced in QTP 9.2 allows adding a Object Repository dynamically to a Action. The code shown below demonstrates how to add a object repository at run-time
RepositoriesCollection.Add "C:\Test.tsr"
The code above associates the Object Repository to the current action. But when the same code is added to a library and associate with the test, [...]
Register or Login to read the full article...
Tags used -
Action, Cannot perform the operation because the action is a read-only action, Dynamic, Object Repository, read only, readonly, RepositoriesCollection

Loading ...
Sometimes clicking on the Object Repository (OR) button on the toolbar does not bring up the Object Repository window. This issue mostly happens with people who use Multiple monitors with QTP and place the Object Repository window on the secondary monitor. When they relaunch QTP with only one monitor connected, QTP remembers the old co-ordinates [...]
Read the full article...
Tags used -
hidden, invisible, missing, multiple monitors, not visible, Object Repository, OR, toolbar

Loading ...
QTP provides 4 methods for working on a Test object properties
GetTOProperty
SetTOProperty
GetTOProperties
GetROProperty
A lot of times developers (Yes we are not testers) using QTP mix these methods and don’t know which one to use in which situation. After reading this article you will clearly understand Why, When and How to use these methods.
Before we go deep into [...]
Register or Login to read the full article...
Tags used -
GetROProperty, GetTOProperties, GetTOProperty, identification, Object identification, Object Repository, Repository, SetTOProperty, Smart Identification, test object

Loading ...
This article discusses how we can convert an Object repository based script to DP based script. For this we will do a simple recording of entering some text on Google.com search text box and clicking the Google search button
The QTP generated script would look something like below
SystemUtil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
Browser("Browser").Page("Page").Sync
Browser("Browser").Navigate "http://www.google.com"
Browser("Browser").Page("Google").WebEdit("q").Set "KnowledgeInbox"
Browser("Browser").Page("Google").WebButton("Google Search").Click
All the names [...]
Register or Login to read the full article...
Tags used -
Convert, Descriptive, Descriptive Programming, Object, Object Repository, OR, Repository