Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which properties to use to access or identify (runtime) objects using script ???
#1
Not Solved
In one of my actions, I would like to access links from the run time page whose title is equal to a constant. I do not have defined this link as a object/resource in any local or shared object repository. The reasons are: the names, hrefs etc values of this link object are dynamically filled and it varies from run to run. So I thought to add a common title to these links and access them with the script this way (this is the action script in Expert View):

Code:
identOne = "title:=LinksOfCertainType"
counter = 0
indexId = "index:=" + CStr(counter)
While Browser("MyLicense Office").Page("MyLicense Office").Frame("mainFrame").Link(identOne,indexId).Exist(0)
Browser("MyLicense Office").Page("MyLicense Office").Frame("mainFrame").Link(identOne,  indexId).Click
'other processes..etc
counter = counter + 1
indexId = "index:=" + CStr(counter)
Wend

Runtime, if I spy this link object, I see the title value "LinksOfCertainType". Q1: I do not know why my code fails at the exist call.

So I am doubting Q2: if we can just use only the title property, in the script, to identify/access a runtime object. Then I cannot use the other properties easily.

Other thing is, these links are columns of a table... So I thought of to identify the table first, then go row by row, and corr. column, to pick up these links. Q3: How can we identify a table at runtime. When we say ....WebTable("something")... what is this something, is it the table name or... what property is it?
Reply
#2
Not Solved
I guess, for Link or WebTable objects (that are not in local or shared Repository), in which case direct script is used to identify, we cannot use Title attribute/property to identify. If we see in HP QuickTest Professional Object Model Reference -> Web (environment) -> Link ->Click on Link identification properties-> we do not see title property listed among the others.
However the Note in the same help document-page says as below:
Quote:You can also view a list and descriptions of the Link identification properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.

But, When I go into QTP->Tools->Object Identification->(select) Web->Link-> I see title as one of the properties that can be used to identify...Why would they give title as a choice for an identification property if the other Note in Object Model Reference Help says differently.

Kind of confused. Please correct me if I am wrong. Probably I might be missing some basic concept here.

Also, I try to grab a collection of link objects using script, I get their getROProperty "title",
Code:
Set linkDescription = Description.Create()
linkDescription("html tag").value="A"
Set links = Browser("Browser").Page("Page").Frame("Frame").ChildObjects(linkDescription)
links(iter).getROProperty("title")
I do not see anything even though the title in the HTML source has value in it. Using Object Spy, I am able to see the value for the title. I do not understand this difference of behavior between the Object spy and the script.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT CAN'T IDENTIFY OBJECTS ORGIO 3 2,353 07-28-2018, 01:25 AM
Last Post: marcelodruida
  UFT unable to identify Java app objects consistently lester 1 1,986 07-12-2018, 08:28 PM
Last Post: Ankur
  Collecting Objects And Object State At Runtime zunebuggy 3 1,702 11-22-2017, 02:37 PM
Last Post: supputuri
  How to identify hidden objects shinoj123@gmail.com 1 4,248 09-13-2015, 01:21 AM
Last Post: ADITI1992
  Qtp 10.0 Not able to identify objects on Win 8.1 64 bit OS hpuser 1 2,307 06-11-2015, 06:43 PM
Last Post: venkatesh9032

Forum Jump:


Users browsing this thread: 1 Guest(s)