08-07-2011, 06:31 PM
Hi,
I want to automate clicking on a dynamic link(Comments) which opens a new browser window...For some reason even though QTP recognizes the object, it doesn't open the comments in a new window
Here's the code:
I want to automate clicking on a dynamic link(Comments) which opens a new browser window...For some reason even though QTP recognizes the object, it doesn't open the comments in a new window
Here's the code:
Code:
' Create description for all Links on a Web page.
' For that we use "html tag" property and its value "A"
Set descLink = Description.Create
descLink("html tag").value = "A"
descLink("text").value= "0 Comments"
' Get all Links which match the above description
Set listLinks = Browser("abcd").Page("abcd").ChildObjects(descLink)
While (listLinks.Count =0)
wait(3)
Browser("abcd").Refresh
Wend
If (listLinks.Count =1) Then
wait(4)
If (listLinks(0).exist) Then
listLinks(0).Click
End If
End If