Practical ways to improve my selectors?

how to have the best selector , what i mean how to make sure that the selector i chose is the best ,and will be valid after couple of days , for example let say i have selector by id and tag its work fine but after few days i need to indicate again to make it valid !

1 Like

Hi @alialroomi

Maybe this post will help you:

Thanks and regards.

5 Likes

many thanks jan , already know this post , but what i’m looking for is an answer based on your experiment and experience that comes from practical practise .

:slight_smile:
regards

1 Like

Hi @alialroomi

I would say that a good selector is both simple and descriptive:

  • use as little of IDs as possible - a name is better than the ID
  • figure out if the name changes slightly and use * or ? to wildcard characters that are variable
  • if you make use of the anchors, make sure they are stable

It is all about finding the bare minimum for the selector to work reliably.

4 Likes

thanks :slight_smile:

1 Like

Alialroomi,

In addition to loginerror’s advice, I generally try to avoid any selectors with div/path for websites, as these are very likely to change if the page gets updated in any way.

1 Like

Another way would be to have selector expressions configured as parameters in some file. Should they change, all you will need to do is to re-validate the selectors and update the file.

Unfortunately, we cannot control how commercial cloud software deals with their interfaces and designs.
I’m hoping that future specifications of the HTML standards will come out with some kind of attribute to make visual interfaces RPA-friendly so that selectors would be limited to plain and simple key value pairs.

2 Likes