Forum Discussion

kandy1984's avatar
kandy1984
Contributor
10 years ago

Test Complete cant see the right clicked menu

Hi,

 

I am trying to record the action when user right clicks to open a context menu and then click/mouse hover on an item on the context menu which will open up another context menu. TC fails saying that 'The window is invisible and thus cannot be activated" and stops there. How can do this test do that the funtion comming from each context menu can be tested.

 

Please refer to the attached menu of the context menu.

 

Thanks for helping :-)

  • NisHera's avatar
    NisHera
    Valued Contributor

    is it desktop application or web?

    if a desktop,  is it an open application as in this?

    • kandy1984's avatar
      kandy1984
      Contributor

      Hi Nishera,

       

      this is a desktop application. no this is not an open application. it is a in-house developed in .NET.

       

      Thanks.

      • msaunders's avatar
        msaunders
        Contributor

        I ran in to a similar issue with my companies .net application. I had to have them implement a right click command line essentially.

         

        I turn on a special mode from a test menu which exposes a .net commandline panel, i then set text in that window to equate to something from the right click menu. Then i send [enter] which sends the command through the right click piping sneaking around the fact right click does not work.

         

        It was annoying but it works well, just had to talk the developer in to doing it. 

         

        sample code

         

        //this opens the right click menu in scene

        cmdBox.SetText("widget clt_context_menu_show");
        cmdBox.Keys("[Enter]");

         

        //This selects the item from the right click menu
        cmdBox.SetText("widget clt_context_menu_exec \"Elevation: Unlock\" ");
        cmdBox.Keys("[Enter]");

  • Hi, kandy1984

     

    Please, record the actions that opens the context menu which has the "Change to..." option and clicks the the "User defined" option and post it here.

     

    Regards,

     

    Leandro de Araújo Souza

  • You open the popup menu with a right click, but you don't need to hover and wait for the submenu in order to click its item.

    You need to put both the popup menu and the submenu in your click call... 

    Instead of 

    Call ...Click("Change To...")

    Call ... Click("User Defined")

     

    You need

    Call ...Click("Change To...|User Defined")

     

    Trying to do it separately doesn't work because the popup closes as soon as the first click command runs.