Forum Discussion

Manfred_F's avatar
Manfred_F
Regular Contributor
5 years ago

update object browser by script

I'd like to view contents of an application's context menu. Using TC closes this context menu.

Can I update the object browser by script e. g. every minute?

  • Hi,

     

    If I understand correctly, the individual items are not selected using Object Spy, therefore you want to use the keyboard input to select an item. It looks like the mouse movement doesn't allow doing this. I find this quite strange actually. 

     

    In this case, you need to open the menu in your test, then you can call the Refresh method for the parent object of this menu (you can explore this in Object Spy), and then call the Keys action to simulate the keystrokes: Keys("[Down][Down][Enter]") to select a needed item.

     

    I hope this helps.

  • BenoitB's avatar
    BenoitB
    Community Hero

    In object spy use Point and fix method to inspect context menu and similar on-fly object.

    TC won't close the menu if using this method.

     

    By script you can store an object of the context menu or put a breakpoint and explore data at this time.

    • Manfred_F's avatar
      Manfred_F
      Regular Contributor

      thx,

      point and fix is fine for the menu, but it doesn't get me the items.

      Navigation in the spy does not work, as mouse actions close the menu.

      • YuriPeshekhonov's avatar
        YuriPeshekhonov
        SmartBear Alumni (Retired)

        Hi,

         

        If I understand correctly, the individual items are not selected using Object Spy, therefore you want to use the keyboard input to select an item. It looks like the mouse movement doesn't allow doing this. I find this quite strange actually. 

         

        In this case, you need to open the menu in your test, then you can call the Refresh method for the parent object of this menu (you can explore this in Object Spy), and then call the Keys action to simulate the keystrokes: Keys("[Down][Down][Enter]") to select a needed item.

         

        I hope this helps.