GeekInterview.com
Series: Subject: Topic:
Question: 7 of 779

How would you click on a link in QTP?

note: properties are not known in a Webtable? Can someone clearly explain this?
Asked by: yaswanth.akkisetty | Member Since Apr-2012 | Asked on: Apr 11th, 2012

View all questions by yaswanth.akkisetty

Showing Answers 1 - 1 of 1 Answers
Denis Parker

Answered On : 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

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.