I haven't tried anything with right mouse menus. Does the menu show after your
panel.RightClick();
Else, isn't the context menu part of your panel?
Have you tried using
panel.RightClick();
var propClick = panel.Get<MenuItems.PopupMenu>(SearchCriteria.ByText("Propeties"));
propClick.Click();
instead?
Or maybe you could try Menu instead of PopupMenu
var propClick = panel.Get<MenuItems.Menu>(SearchCriteria.ByText("Propeties"));
or just let white decide for you first, and read the type by putting a breakpoint
var propClick = panel.Get(SearchCriteria.ByText("Propeties"));
EDIT:
To add to this, the following methods might help to select the context menu by using the keyboard commands.
To add to that, you might want to try to select the menu with keyboard.
White does not have a special key for the context menu (right mouse menu), but the method below can help with that.
/// <summary>
/// Right mouse click simulation (SHIFT+F10)
/// </summary>
/// <param name="container">Container in whish the click should occur.</param>
private static void ShowContextMenu(this UIItemContainer container)
{
container.Keyboard.HoldKey(KeyboardInput.SpecialKeys.SHIFT);
container.Keyboard.PressSpecialKey(KeyboardInput.SpecialKeys.F10);
container.Keyboard.LeaveKey(KeyboardInput.SpecialKeys.SHIFT);
}
and this one to select the context menu
/// <summary>
/// Get the context menu (right mouse menu) of <paramref name="container"/> whre the current focus is.
/// </summary>
/// <param name="mainWindow">Main window of the application, because the context menu is always a child of the window.</param>
/// <param name="container">Container on which the right click shoul occur.</param>
/// <returns>Context menu</returns>
internal static PopUpMenu GetContextMenuOf(this Window mainWindow, UIItemContainer container)
{
using (CoreAppXmlConfiguration.Instance.ApplyTemporarySetting(c => c.PopupTimeout = 750))
{
container.ShowContextMenu();
return mainWindow.Popup;
}
}