Tired of complex locator strings in your UI automation tests?

This week’s article, “How to write visual UI automation tests using graphics instead of complex locator strings” by @stefan_testupio, explores how using images rather than text-based locators can simplify your automated UI testing.

What You’ll Learn:

  • :camera: Visual test scripting: Discover how to use screenshots and images in place of complex locator strings, making your tests easier to write and maintain.
  • :warning: Reduce test dependencies: Learn how image-based UI tests are less reliant on the internal structure of an application, offering more stability and flexibility across platforms.
  • :robot: Passive vs. active visual testing: Explore both passive visual regression testing and active use of images for test execution, and see how each method fits different scenarios.

After reading, we’d love to hear from you:

Have you used image-based testing before? Share your experiences or tips on how visual testing has worked for you!

1 Like

Funny how out of context this is for me at least.
I work on a web app with 0 images.
In the previous product, the images would lazily load after the rest of the page would. Using images would have slowed my automation x2-x3 times.

1 Like

@ipstefan Web apps are graphical front ends. Even if you are not using typical image formats you would define graphical content using CSS, SVG or plain HTML. If you want to check if this is rendered correctly, you would have to look at the screenshot and compare it with a reference. This is what the passive approach is about. The active use case is a bit slower. Appium’s image search can take up to 100ms per click, depending on resolution.

1 Like