Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Regarding GetTextLocation
#1
Not Solved
Hi all, how do we get to know the co ordinates of a Search text from QTP, which occurs more than once.

or how do we know the No.of occurances of a text on a page???

i was trying with below code.

Code:
Call GetTextLocation

Sub GetTextLocation()
l = -1
t =  -1
r =  -1
b=  -1
InputLink="http://www.sportingbet.com"
Set GameRef=Window("regexpwndtitle:=Microsoft Internet Explorer","text:="&InputLink&".*").WinObject("Object class:=MacromediaFlashPlayerActiveX")
If GameRef.Exist Then
    result =GameRef.GetTextLocation("Spin", l, t, r, b)
    If result Then
    MsgBox "Text found. Coordinates:" & l & "," & t & "," & r & "," & b
        x = (l+r) / 2
        y = (t+b) / 2
        GameRef.Click x,y,0
        End If
End If
End Sub


when i run this script this will identify the first occurance of "Spin", but how to get the Nth occurance of Random Button.

In my case "Spin" is found two times as
1.Last Spin as Plain text and
2.Spin - A button

i need to click on Spin Button , where as it is clicking on Last Spin Plain Text.
Reply


Messages In This Thread
Help Regarding GetTextLocation - by koti.deva - 12-08-2009, 04:57 PM
RE: Help Regarding GetTextLocation - by koti.deva - 12-09-2009, 10:30 AM
RE: Help Regarding GetTextLocation - by chaitali - 02-05-2014, 03:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  GetTextLocation method elsekra 1 8,372 03-12-2009, 06:45 PM
Last Post: MVChowdary

Forum Jump:


Users browsing this thread: 1 Guest(s)