Thank you for the clarification. It is much more clear to me now the automation problem you are faced with.
First, as a clarification, Test Studio does not support data driving the element finder. Using code we could create a data driving find expression, but I understand you want to try and avoid using code.
If I understand correctly what you are really after is to be able to Add a new role, then find and fill in the form for this new role... and for the automation script to be able to do this not knowing how many existing roles were already present when the script runs. Do I understand the challenge correctly?
Unfortunately the Find Expressions that Test Studio supports does not include the concept of "find the last element of type X" and work from there. We can locate elements having a specific set of attributes, or find elements having a specific index value (e.g. locate the 12th label counting from element X), and even the ability of a chaining finds together i.e. find element X then underneath that find element Y.
I wonder if a chained find could be used in your case. For example, if the currently opened form (assuming you can only have one open at a time) always had the automation ID of "OpenedForm" as a static ID, we could use a chained find that would find the form having that ID and then find the input elements it contains by an index number. Is something like this possible in your application?
The only alternative is to implement something in code that can reliably find the right elements to act on, and perform the needed actions.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items