How to set selector dynamically

Hi Community,

I’m using Get text activity under Verify activity of Testing, in that the selector has following tags and attribute

So, how can I set this selector dynamically so that it will always work if anything change

Thanks.

@siddhi

Open ui explorer and check for the attributes which does not have numbers…if there are numbers replace with * and check…

Also I see idx being used try avoiding it and tablerow can be used if you want to check the row else remove that asw ell

Cheers

@Anil_G


there’s no numbers for any attribute

And if I’m putting ‘*’ instead of ‘2’ in the idx value then the selector highlights the wrong element in the Ui.
Is anything need to change in that ?
Please suggest

Thanks.

@siddhi

Grid id is having number in it…

And idx=‘2’ if you replace with start it by default considers 1…when i say remove idx you have to make sure it is 1 or no idx comes when you give the selector…try using combinations from
Right top menu of your ui explorer which might help…

If you are not getting any then see what is the difference between the attributes when 1 and 2 and use the different attributes to make it unique

Cheers

When you say “if anything change”, what are the aspects that you’re epxecting to change on the page? If you don’t know which parts could change, then you cannot really make a bullet proof selector.

maybe you can elaborate more on this

From the screenshot we do see that there is a number 1500008
When it is intended to dynamize on this, then refer to the above shared link for dynamic selectors

@ppr

actually m using Get Text output method to get the data appears on the screen and for further verification activities. And the number 15000008 is not static , it’s showing the last data after reading and printing all the values.

My concern is sometimes this selector is working or sometimes not working

You need to investigate what happens on the structure of the page when it is not working, then. Can you show an example of Ui Explorer when the selector works and when it does not work?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.