GetTextLocation method is not working properly

I am searching a word "DR" withing a Winobjetc by using the below given code;

Window("Job Console").Activate
strFind=Window("Job Console").WinObject("WindowsForms10.Window.8.app.0.").GetTextLocation("DR",l,t,r,b)
If strFind=True Then
msgbox "Coordinates are:"& l & "," & t & "," & r & "," & b
Window("Job Console").WinObject("WindowsForms10.Window.8.app.0.").Click (l+r)/2,(t+b)/2
End If
For search word "DR" , the co ordinates are giving as 0,0,787,389, now if I change the serach word to "DR01322552"( which is not present within the winobject) then also the coordinates are giving as 0,0,787,389.

Can anyone please help me to resolve this issue.
Your help in this regard will be highly appreciated.

Questions by simanta.adhikary

Showing Answers 1 - 3 of 3 Answers

DerpFace

  • Jan 27th, 2016
 

Old question, but a top search result, so heres an answer:
GetTextLocation has an optional 6th parameter that is a bool. When true, it matches whole word. Try setting it to true.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions