Forum Discussion

maxthomassin's avatar
maxthomassin
Occasional Contributor
12 years ago

Get the focused object

Is there a way to get the focused item of my webpage? For exemple, I would like to move to an object using Tab and then get THAT item. all.Item("codeUtilisateur").Keys("[Tab][Tab][Tab]")...
  • dganov's avatar
    12 years ago
    If you need to set focus to the specific item, then just call its focus() method.

    But if you need to know what item will be focused after using [Tab], then I suggest using document.activeElement property. Though it will not be the TestComplete web object.