I’m upto “UI automation descriptors in Studio (v2024.10)” sub section “fine-tuning descriptor”.
The 2nd example shows how to use a variable to dynamically select a target. The example file doesn’t work.
When building the example from scratch, I’m unable to add an anchor, I’m told current mode doesn’t allow anchors. Screenshot won’t work when indicating targets.
If I force the target to fuzzy so I can add an anchor, then go to the xml and replace the employee name with a variable, I get red lines everywhere and
“The configured Project Settings targeting methods are not sufficient for the current target to be correctly identified. Please add other methods in Project Settings > UI Automation Modern > Targeting methods - web browsers”
So I figure I’m doing something wrong, as something like this would be mentioned in a tutorial.
Can anyone help?
Not only in anchor variable can be used in any type of selector…you just need to right click and select the variabel to be inserted or give ‘{{variable}}’ it would add the variable in selector
Now when you add variable make sure you write a default value else it would not get validated
If you use a Strict selector for the target, it won’t allow you to set an anchor directly. You also need to enable the Fuzzy selector for the target first; then you can configure the anchor. Once done, you can uncheck the Fuzzy selector for target.
However, if your application is stable and selectors are reliable, you can avoid using an anchor.
thanks for your response, but my settings page does not have those options to enable.
Version 2026.0.191 STS
Please see screenshot.
The closest seems to be “Selector - default find type” which drop down has 4 options, disabled, one match, all matches and auto. Currently set to Auto, I will try this later when I’m at my machine.
thank-you so much for your response and taking the time to link the example - which works great.
Unfortunately this doesn’t apply to my situation, as I have to apply the variable to an anchor which is the part I’m having trouble with.
However it was useful to see how to use variable in targets, thanks again.
Here is my project. I didn’t want to include my email/password, so you will have to login to the acme website using your own login, then run the project and you should find that it brings up the wrong employee details.
If you check the “click employee details” activity (the last activity) you should see the employee name, carl C Carney, in the descriptor image, is replaced by the EmployeeName variable. The value of the variable is logged to output, but is not the employee detail shown after the click activity.
I assume I’ve missed something, so any help appreciated.
No it still doesn’t work alas. I switch the selector-default find type, and it allows me to reindicate and set the anchor, then assign the variable all goes without a hitch.
But it still ignore the variable value when displaying the employee. I log the employee name so I’m fairly sure the value is correct.
I was unable to find a use anchor activity, tried all combinations of use and anchor.
Finally!
Managed to make it work. The tutorial is well out of date, I had to fill in the Text field (2) in the image below, not aaname (1) as described in the tutorial.
Nightmare.
Thanks for your (prompt) help guys.