03-05-2009, 08:59 PM
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):
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?
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?