Problem with selection in popup menu
Please refer attached image of popup menu in my testing application.
I want to select "Edit Definition.." option from the options. I use code :
Object.PopupMenu.Click("[0]");
This works correctly.
Problem is when I want to select "Select Machine..." option from the options.
I am using the code :
Object.PopupMenu.Click("[1]");
With above code i am getting error "The menu item 1 is disabled" even though this option is in enabled state.
If use code :
Object.PopupMenu.Click( "Select Machine..." );
it works. But what is problem with above code ?
Hi,
As others already wrote,
Object.PopupMenu.Click( "Select Machine..." );
is much better than
Object.PopupMenu.Click("[1]");
The reason why the latter did not work for you is because menu item with index 1 is a separator displayed as a grayed line between Edit Definition and Select Machine menu items.
You should use index value of 2 if you like to select Select Machine menu item by index.