Forum Discussion

JackSparrow's avatar
JackSparrow
Frequent Contributor
8 years ago
Solved

Selecting the MainMenu Options

Hi all,

Am trying to Navigate through the main Menu options as below

menu.png

In the Above Picture Until I click on Home button the remaining options will not be enabled .I need to Select File and Navigate through the DropDown Sub-Menu

 

so I have written the below code

def menuselection():
 
 mainmenu = Sys.Process("Teachers.debug").VCLObject("frmMain").VCLObject("barRibbon")
 mainmenu.Select("Home")
 mainmenu.Select("File|Functions|XYZ|ABC Navigator")

But O/P Shows "Unable to find the object Select("Home"). See Additional Information for details."

  • Maybe using another method to select items will solve the problem?

    I usually use .Click("");

     

    E.g: 

     

     mainmenu = Sys.Process("Teachers.debug").VCLObject("frmMain").VCLObject("barRibbon")
     mainmenu.Click("Home")
     mainmenu.Click("File|Functions|XYZ|ABC Navigator")

     

    Let me know if that works !

  • JackSparrow's avatar
    JackSparrow
    8 years ago

    altemann thanks for the help , actually there is an frame name which was not showing in Object spy but was visible on the menu so in between I linked with that frame name then the menu name as you said so it worked thanks once again

11 Replies

  • Maybe using another method to select items will solve the problem?

    I usually use .Click("");

     

    E.g: 

     

     mainmenu = Sys.Process("Teachers.debug").VCLObject("frmMain").VCLObject("barRibbon")
     mainmenu.Click("Home")
     mainmenu.Click("File|Functions|XYZ|ABC Navigator")

     

    Let me know if that works !

    • JackSparrow's avatar
      JackSparrow
      Frequent Contributor
      def menuselct():
       mainmenu = Sys.Process("Teachers.debug").VCLObject("frmMain").VCLObject("barRibbon")
       mainmenu.Click("Home")
      mainmenu.Click("File|Functions|XYZ|ABC Navigator")

      Am facing an python runtime Error at RedFont Line in the above code

       

      def menuselct():
       mainmenu = Sys.Process("Teachers.debug").VCLObject("frmMain").VCLObject("barRibbon")
       mainmenu.Clickitem("Home")
       mainmenu.Clickitem("File|Functions|XYZ|ABC Navigator")

      And I Even used ClickItem then facing an error that "The bar item 'Home' not found."

      • altemann's avatar
        altemann
        Contributor

        You could try recording the actions you want to execute, then checking out how TC will work with this object. Maybe there's another method to select items in this kind of menu that I'm not aware of!