Forum Discussion

tyrus's avatar
tyrus
Contributor
11 years ago

Current Object in Alias form

Hi, how do you obtain the currently fucused object on the screen, in jscript and keyword tests?

preferably obtain the alias/mappedname. Sys.Desktop.ActiveWindow().FullName seems to only provide the fullname

 

thanks

3 Replies

  • Marsha_R's avatar
    Marsha_R
    Icon for Champion Level 3 rankChampion Level 3

    If you use Object Spy on the object, you can see the alias name at the top of the window.

     

    See attached example.

    • tyrus's avatar
      tyrus
      Contributor

      thanks, I'm trying to get the mapped name programmatically at runtime. Essentially what I am tryign to do is get the name of an object in case of failure.

       

      If the script fails at runtime, I want to be able to determine the name control that is focused. at the time of failure. Is there a way to do this?

       

      var obj = Sys.Process("Application").ActiveWindow().MappedName

       

      doesn't seem to work for me

      thanks

      • NisHera's avatar
        NisHera
        Valued Contributor

        "If the script fails at runtime " of what?

        if script fails becouse could not identify object, that mean TC could not match focused object with mapping.

        so in that situation TC could not provide name mapping of object.

        but TC can provide what ever property of object it can read.

        eg 

        var obj = Sys.Desktop.FocusedWindow().Name;
        Log.Message(obj);