| || |
Method to return co-ordinates
Hi there, does anyone know of a method I can use to return the co-ordinates of a text string contained in a profgrid? I was looking at GetTextLocation, but that just returns a boolean value, and I really need the x/y coordinates.
Re: Method to return co-ordinates
From QTP help file
<font class="small">Code:</font><hr /><pre>
The following example searches for the word Mercury within the entire screen and clicks it if the word is found.
l = -1
t = -1
r = -1
b = -1
Succeeded = TextUtil.GetTextLocation("16",0,l,t,r,b)
If Not Succeeded Then
MsgBox "Text not found"
x = (l+r) / 2
y = (t+b) / 2
Set dr = CreateObject("Mercury.DeviceReplay")
dr.MouseClick x, y, 0