Micro Focus QTP (UFT) Forums
To get Link names randomly and to click.. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: To get Link names randomly and to click.. (/Thread-To-get-Link-names-randomly-and-to-click)



To get Link names randomly and to click.. - ramkumn - 03-29-2010

Hi

I have an web application, In that i have two tabs in each tab have nearly 100 links,
Every time i want to click on the links randomly to to open other page.

Firstly i used description object to get the count of the links.. but i didn't get the next

Can any one please give me the reply.. do i need a java-add in for this ?
While i spy on the objects i see the class as web-Element... Can't we do this wit out java add-in ??


Thanks in advance
-Ram


RE: To get Link names randomly and to click.. - Saket - 03-30-2010

I guess, the links which you say are actually WebElements, i dont think you need java add-in.
Can you attach the spyshot and the code whatever you tried?


RE: To get Link names randomly and to click.. - ramkumn - 03-30-2010

The below code has given me the total links count in the browser

Code:
Set oDesc = Description.Create()
oDesc("micclass").Value = "Link"
Set Links = Browser("Sample").Page("SamplePage").ChildObjects(oDesc)
Msgbox "Total links: " & Links.Count

See the attache ss

Thanks
-Ram


RE: To get Link names randomly and to click.. - Saket - 03-30-2010

change the value of micclass to WebElement, as the object is webelement per spyshot.