I need my automation to select a Ui element based on an anchor which could change. Thus, I have been trying to implement dynamic selectors by changing the “aaname” of the anchor element to a wildcard / argument which would be assigned the value I want.
Although this works if I assign the argument a default value, it will not work if I assign this argument to a variable that contains the value I want. When I try this, I get this pop up (see attached picture).
Ultimately, I need the latter option to work because this workflow will be invoked and the value of the “aaname” will be passed from variables in the main workflow to the arguments in this invoked workflow.
So to repeat my question: is it possible to assign a variable to an argument (during an invoked workflow) and then use that argument (without a string default value) as a wildcard for a dynamic selector?
I have set up a message box which confirms that the value is being assigned to the argument, but it still cannot find the ui element. I have also tried putting a delay in but that didn’t solve it.
Make sure you don’t have a variable with the same name as the argument. Also, that first screenshot you posted is because you’re trying to use a variable while designating the selector. I find it’s easier to just let it get the selector with the specific text, then copy/paste the selector into notepad and edit it manually to replace with variables. Then paste back into the activity’s property.
I generally use strict selectors as long as they work, whether I’m using variables or not. I prefer to have my selectors exact, and don’t really like how fuzzy will find things that are close. Close is not right, in my brain.
Take the class out of your selector. That’s an unreliable attribute. Also remove type since it’s blank. DIV and aaname should be enough to uniquely identify the UI element.
It may just be my imagination, but is there an extra space before and after (x) Category?