I’m trying to automate a process wherein the robot opens Notepad, and depending upon what value I put as default for the UiPath variable MenuOption (currently the value is “View”), the robot either opens up the File, Edit, or View menu options.
The Dynamic Selector won’t validate and I think my syntax is correct. I have no explanation of why it’s not validating.
When I actually run the bot, it always clicks on File regardless of what value I have in MenuOption (it always clicks on File because that’s the menu option I indicated for the Click activity, but the functionality I want is to click on any of the 3 menu options based on the value of the MenuOption variable).
I’m modifying the Strict Selector - not the fuzzy selector or window selector.
See attached screenshots.
The line of the selector in question is
<uia automationid='File' cls='Microsoft.UI.Xaml.Controls.MenuBarItem' name='{{MenuOption}}' />
The original partial selector was
<uia automationid='MenuBar' role='menu bar' />
<uia automationid='File' cls='Microsoft.UI.Xaml.Controls.MenuBarItem' name='File' />
Looked through the forums and couldn’t find an answer. Much appreciated. Thanks - Josh


