Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic Link which opens in new window Help
#1
Not Solved Question 
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:
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
Reply
#2
Not Solved
Hi,

I do not see any code for entering the comments.

Code:
If (listLinks(0).exist) Then

[b]Browser("abcd").Page("pqrs").listLinks.set "xyza"[/b]

listLinks(0).Click

End If
Reply
#3
Not Solved
Huh? It's a link in a browser page and I want to click on it - Which should result in a new window being opened but it's not happening

To be clear, "0 comments" is a an object of class Link
Reply
#4
Not Solved
Hi,
Can u plz do a object spy on the link and share us the snapshot. And also try

Msgbox listLinks(0).exist

see whether u r getting a message as True.
Reply
#5
Not Solved
hi,

Could you please try the below description for weblink

Code:
Set descLink = Description.Create
descLink("micclass").value = "Link"
descLink("text").value= "0 Comments"

Regards,
Parminder
Reply
#6
Not Solved
Thanks for your suggestions

Msgbox listLinks(0).exist gives a true

I tried with descLink("micclass").Value="Link" - Same result

The problem as I understand is not object recognition. QTP recognizes the link object.

Problem is, when I manually click on the dynamic link, it opens a new browser window with comments in it. Kind of like a chat window. It's not happening when I use QTP to do the same
I object spied the link properties and here they are ,listed(I can't attach screenshot)

Class Name:Link
Html tag:A
href: http://abcd.com/# - I think this is the problem
url: http://abcd.com/#
text,innerhtml,innertext,name: 914 Comments - (This keeps changing as this a dynamic link)
outerhtml: <A
visible: True
Reply
#7
Not Solved
Hi,

Before listLinks(0).Click
Put listLinks(0).Highlight and observer whether your link is getting higlighted or not, If yes Check is there something blocking your new window/popup.

Thanks,
Suresh.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Object doesn't support this property or method: 'window(...).window(...).winobject' senthil5683 1 3,719 07-04-2016, 07:08 PM
Last Post: venkatesh9032
  How to click on a dynamic link on a website Geekgirl 3 4,597 11-28-2013, 11:53 AM
Last Post: Jay
  Dynamic variable in link call rdix007 1 2,858 03-28-2013, 07:02 AM
Last Post: basanth27
  To Delete Dynamic Link Present in a WebTable sheikadil15 0 2,425 04-16-2011, 12:54 PM
Last Post: sheikadil15
  Link to a file in the test result window tennessee 0 2,039 01-24-2011, 07:31 PM
Last Post: tennessee

Forum Jump:


Users browsing this thread: 1 Guest(s)