How would you click on a link in QTP?

Note: properties are not known in a Webtable? Can someone clearly explain this?

Questions by yaswanth.akkisetty

Showing Answers 1 - 3 of 3 Answers

Denis Parker

  • Aug 7th, 2012
 

Hope, it is difficult to develop a script if the properties is unknown, but we can try with standard properties, like if property is a LINK then it can be attach the name or type property with "link" or html tag property with "A". Use the child object to get the information.

Code
  1. Dim oDesc

  2. Dim oChildren

  3. Dim i

  4.  

  5. oDesc = Description.Create

  6. oDesc("name").Value = "Link"

  7. ----We couldve left the oDesc object blank, To get all objects----

  8.  

  9. Set oChildren = Browser("title:=google.*").Page("title:=google.*).WebTable("html Tag:= TABLE").ChildObjects(oDesc)

  10. ----Now oChildren holds the Link collection----

  11.  

  12. ----Run through the collection----

  13. For I = 0 to oChildren.Count-1

  14. ----Select the specific Link----

  15. oChildren(i).Click

  16. Next

  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