Is there a way to use a test parameter to locate an element?
In the project I am looking to automate, we have pages where I can create a new object with a name through the UI that then appears on main page as a link. The text value of that link is the name of the object. The link only has a class attribute of 'fieldset-edit-link' and no other attributes I could use to id it.
If I add multiple objects, I get lots of link as above with the same class attribute.
Obviously there could be no links added or one, or many depending on what the test dictates.
Mapping one of these links would give me something like '//a[contains(text(), 'My New FieldSet')]'.
Is there a way I can do something like add a test case parameter name in that locator in place of the name?
So something like this: '//a[contains(text(), $MyTestParamContainingTheNameIAmAfter)]'
Then, when I add this object as On-Screen Action, it would then give me the option to select what goes in to that variable in the locator (constant, test parameter, variable, last operation result etc).
I am not sure I have explained this very well, but hopefully somebody will get one I am asking 🙂
Re: Is there a way to use a test parameter to locate an element?
Thank you for your help. Doing it through script and then adding a 'Run script routine' to the test is a good solution. Just wondered if there was a UI way of doing it through on-screen actions, but this will do just fine.