gentlesea
14 years agoFrequent Contributor
Menu items are not displayed in log
I want to test whether a certain item is available in a context menu or not.
I used the following example which I took from the documentation in order to iterate through a context menu.
function MenuSample()
{
Aliases.MainWnd.MenuBar.TrvwPlan.ClickItemR("|<IconDosePlan>The RTPlan|<TreatmentGroup_deselected>Group 1");
var MainMenu = Aliases.MainWnd.MenuBar.TrvwPlan.PopupMenu;
// Defines the total number of main menu items
var Count = MainMenu.Count;
// Iterates through the menu items
for (var i = 0; i < Count; i++)
{
// Obtains the menu item
var Item = MainMenu.Items(i);
// Posts the item caption to the test log
Log.Message(Item.Caption);
}
}
Something seems to be wrong with the context menu since I get the following log output:
Log.Message(Item.Caption); produces for each item
Type Message Time Priority Has Picture Link
p? 12:13:38 Normal
See also screenshot. Does anyone have an idea what is going wrong here?