2023-03-02 –, Gather Town
Junior automation testers are taught that fragile selectors of web elements are wrong, and that stability should be their goal. Then they usually end up with their selectors being too stable. What? Is there such a thing as a too stable selector? Don't we want a selector to describe its element, come rain or shine? Long story short: we don't.
The design of the web elements’ selectors is one of the most important design features of the front-end test automation. Although it might sound good, the maximum possible stability of selectors is not desired. The problem of a too stable selector is that it describes an element even if its substantial characteristics have changed. What are "substantial characteristics"? The only reasonable answer, covered in this talk, is that these are the ones determined by the scenario for the test automation—or by a common sense when the former is missing. A short example: users/testers are used to seeing a "Continue" button in a certain place in an application. Then a sudden change in the application renames the "Continue" button to "Next". Are the users/testers going to be confused? Yes, they are. And should the test handling the "Continue" button, which simulates users’ behaviour, fail? It should—but it won’t if the button is referred as id=cont_btn
instead of its title.
Born with sharp thinking, sense of detail and a cheeky mouth, I thrilled my teachers—both in the positive (maths, physics) and the negative (PE etc.) way. I worked as a scientist and a software developer; however, 8 years ago I found the area matching my unique blessings and curses the most: software testing. Nowadays I annoy my teammates and bosses in the greatest Czech bank: Česká spořitelna. One of my professional interests is explaining everyone why their code in Robot Framework (or Python or any other language) is dirty, fragile, slow, or simply terrible. The other one is creating internal standards of doing almost everything. I also like to mentor juniors to turn them into the same beasts as I am. My personal interest is studying at universities and thus I just completed 30th year of my school attendance.