How to identify four similar java links in page ?

How to identifier 4 similar java links in an page
I have 4
similar java links in a same page, in their objects properties, only href are
different.
Here are links:
Java("*", 03/01/2006)
Java("*",
02/06/2006)
Java("*", 10/09/2006)
Java("*", 11/05/2006)
In object
repository, I named first link to "date_01" and done this:
For i =0 to
3
browser("b1").page("p1").link("Text", date_01 ).setoproterties "index"
,i
browser("b1").page("p1").link("Text", date_01 ).Click
next
This
click 4 times to the first links. How to change the script to click to each
link?
Thanks

Questions by lozzko

Showing Answers 1 - 1 of 1 Answers

vasavi

  • Jul 21st, 2006
 

Hi,

     As u have four similar links with just one property changes, you can use descriptive programming rather than going for  such code.

If you are getting  the links at runtime  then u get get property  value for href at run time and use it in descriptive programming, otherwise ucan use it normally.

Here is the procedure for descriptive programming

set desc=Description.create()

desc("Text").value="06/06/06"  /* if this value changes for each run then u can capture that and can assign it   here

desc("href").value=.........  /* Enter href value

then  use this object in the script

browser("b1").page("p1").link(desc).click

thus above coding  is used to click one link. if u want to click 4 links

then create 4 objects if u know the values of properties before running script otherwise

 just put the same in loop. for varying values of properties for each link whihc we get during runtime . Use GetRoproperty  to get value at run time and assign it to descriptive object.

If still u are not able to click four links , tell me more cleary wat exasctly u want

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions