Forum Discussion

s5h's avatar
s5h
Contributor
10 years ago
Solved

HTML Check if object has the focus

Hi 



I was wondering how you would check in TC if a HTML object like a textbox currently has the focus. 



I have tried the document.HasFocus but does not work for me. 



any ideas
  • Try to use document.activeElement property. It will return the native web object, so it will not have TestComplete specific properties and methods.

2 Replies

  • Try to use document.activeElement property. It will return the native web object, so it will not have TestComplete specific properties and methods.
  • s5h's avatar
    s5h
    Contributor
    Thanks I used the Document.ActiveElement.Name property to determine of the property is equal to the objectname 



    Thanks