coolShaily Absent Member.
Absent Member.

TextUtil is not working in QTP on Windows 7



I have return a function to click a text by finding that text through the coordinates. It is working on Windows XP but when execute this code on Windows 7 , the System crashes and BSOD dispays on the screen, as soon as it enters into the code.


Can anyone have the solution?


I am using QTP 10.


The Function is :


Function f_Find_ClickText(strTxtToFind, bClick,clickXoffset, clickYoffset,bMatchWholeWords)

  Dim i,t,r,b,x,y,Succeeded
  i = -1
  t = -1
  r = -1
  b = -1   
  Succeeded = TextUtil.GetTextLocation(strTxtToFind,0,i,t,r,b,bMatchWholeWords)
  If Not Succeeded Then
   f_Find_ClickText = False
   If (bClick) Then
    x = (i+r) / 2  
    y = (t+b) / 2   
    Set dr = CreateObject("Mercury.DeviceReplay")   
    dr.MouseClick x+clickXoffset, y+clickYoffset, 0     
    Set dr = Nothing   
   End If
   f_Find_ClickText = True 
  End If
End Function

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.