Waldo, where's my UI?
Tags: android, automated, testing, waldo
Published: 2021-01-27 19:41:44

Today, [Waldo.io](https://waldo.io), a **no-code** platform for **automated mobile tests**, announced general availability of their Android support.

{% twitter 1354481799611736075 %}

I was recently talking with the CEO of Waldo, Amine Bellakrid. I told him that the llama logo was super cute and the UI gorgeous... but I had doubts a no-code platform was a good fit for automated mobile tests.

# The problem with no-code tests

No-code platforms typically provide a recorder tool that lets you navigate through the app, recording everywhere you tapped. Then later on you can replay the test automatically, and get notified when it fails.

Automated tests are expected to fail when a change breaks the correct behavior of the app. Unfortunately, no-code platforms tend to generate **brittle** tests that also fail on small changes that didn't introduce incorrect behavior.

This creates a lot of noise, so teams tend to stop updating and running these tests and they just rot in a corner.

Note: similar problems can happen with code based tests, but we've introduced patterns to work around them (e.g. [Testing Robots](https://academy.realm.io/posts/kau-jake-wharton-testing-robots/))

# Apparently Waldo is different

When I shared my doubts, Amine smiled and said I should try Waldo. So I created a new example project with 3 tabs:

![Screen Shot 2020-11-20 at 10.50.09 AM](https://dev-to-uploads.s3.amazonaws.com/i/ndu2yh1e955107fx9r5t.png)
 
I recorded a simple test on Waldo.io, tapping on the second tab (Dashboard) and then the 3rd tab (Notifications).

![Screen Shot 2020-11-20 at 10.51.38 AM](https://dev-to-uploads.s3.amazonaws.com/i/zz82o2tpr56n0n7nyd8u.png)
 
# Messing with Waldo

## Tab swap

I started by swapping out the second and the third navigation tab:

![Screen Shot 2020-11-20 at 10.56.58 AM](https://dev-to-uploads.s3.amazonaws.com/i/udq71arftkpznm1pet60.png)

The result is interesting: Waldo clicked on the correct tab (Dashboard) even though it changed place, and the test passed.

![Screen Shot 2020-11-20 at 10.59.09 AM](https://dev-to-uploads.s3.amazonaws.com/i/vl4lh9nr1pjbkxdq5pgu.png)

## Changing strings

Next, I renamed the _Dashboard_ tab to _Summary_ . Still ✅ .

![Screen Shot 2020-11-20 at 11.09.07 AM](https://dev-to-uploads.s3.amazonaws.com/i/g3tqqdaphhtqp1fxf77h.png)
 
## Changing everything else

Ok, time to make this really hard. I also changed the tab menu id and its icon. No way this can still work.

![Screen Shot 2020-11-20 at 11.15.03 AM](https://dev-to-uploads.s3.amazonaws.com/i/rml4w21877f94iv4b21k.png)

... the test still passes and finds the right tabs to tap on, in the right order.

![Screen Shot 2020-11-20 at 11.17.21 AM](https://dev-to-uploads.s3.amazonaws.com/i/qq32v40o1pii2l4g185x.png)

One thing that's really cool in the screenshot above:

> Screen similarity should be at least 70%.
> Current similarity: 93%

I don't know how the similarity is calculated, but it seems more advanced than a simple matching on view ids, bitmap content or string content. That explains why Waldo is totally fine with me changing the UI.

## Ok but I really want to break it

I decided to just be mean and remove the tab. Take that Waldo!

![Screen Shot 2020-11-20 at 11.23.07 AM](https://dev-to-uploads.s3.amazonaws.com/i/9lu7bu6hxrkexz6x7p8f.png)

This time the test is failing 😏.

![Screen Shot 2020-11-20 at 11.25.28 AM](https://dev-to-uploads.s3.amazonaws.com/i/tkbd4mbx19ip95x5j0ih.png)
 
Let's see what happens when I click *Update test*:

![Screen Shot 2020-11-20 at 11.29.57 AM](https://dev-to-uploads.s3.amazonaws.com/i/78slpq3dwpbv3p7j677l.png)
 
The recorder is on the right, the new scenario at the top left and the old scenario at the bottom left. Now that I have only two tabs, I click on the Notifications tab and the scenario is immediately updated. Nice!

# Conclusion

I changed my mind: no-code test platforms don't have to be brittle!

I don't know all the details of how Waldo does it, so I hope they can share more about it some day and bring the community forward. In the meantime, I would definitely give [Waldo](https://www.waldo.io/) a shot.

> Full disclosure: Amine is my friend and I've been advising the Waldo team every now and then on some cool Android tech problems. I wrote this blog on my own though.