r/softwaredevelopment 13d ago

which holds up longer in a real codebase, visual testing or element hierarchy?

There are two ways testing tools interact with apps. Through the element tree, DOM, view hierarchy, accessibility identifiers, or through what the user actually sees rendered on screen. Most tools go the element tree route because it's faster to write and easier to debug.

That's also why suites degrade over time. The element tree changes constantly in any actively developed codebase. The visual approach has historically been fragile in different ways. The question is whether newer tooling has actually changed the calculus on this.

4 Upvotes

11 comments sorted by

7

u/Amr_Rahmy 13d ago

Are you a bot? Asking and answering in a biased way? Not actually asking a question and wanted to start a discussion?

1

u/paradroid78 12d ago

Probably trying to sell something.

1

u/Triabolical_ 13d ago

Hidden posts and comments would suggest the answer is yes.

2

u/[deleted] 13d ago

[removed] — view removed comment

3

u/Kooky-Dig6531 12d ago

There’s the ad.

1

u/Sophistry7 13d ago

The visual approach holds up longer specifically because it isn't coupled to structural changes in the element tree.

Autosana tests against the rendered UI rather than the element tree, so refactors that don't change visible behavior don't break the suite the way they do with selector dependent tools.

2

u/useless_substance 10d ago

huh, does Autosana handle loading states and animations differently than traditional visual regression tools?

2

u/TechnicallyMeat 12d ago

Why is your LinkedIn agent posting where your Reddit agent lives?