select_context_menu#
- async omni.kit.ui_test.select_context_menu(
- menu_path: str,
- menu_root: ~omni.ui._ui.Widget = None,
- offset=Vec2 (100,
- 10),
- human_delay_speed: int = 4,
- find_fn=<function _find_menu_item>,
Emulate selection of context menu item with mouse.
Supports nested menus separated by `/`:
await ui_test.select_context_menu("Option/Select/All")
This function waits for current menu for some time first. Unless `menu_root` was passed explicitly. When there are nested menu mouse moves to each of them and makes human delay for it to open. Then is emulates mouse click on final menu item.
- Parameters:
menu_path (str) – Path to menu item using forward slashes for nested items.
menu_root (ui.Widget) – Root menu widget; defaults to current active menu.
offset (Vec2) – Mouse position offset from menu item center.
human_delay_speed (int) – Delay speed multiplier for realistic mouse interaction.
find_fn (callable) – Function to locate menu items within the menu structure.
- Raises:
Exception – If context menu or menu item cannot be found within timeout.