The Invisible Bug That Broke My Automation: How OCR Changed The Game

The evolution of AI in test automation: from locators to generative AI (Part 3)

The Evolution of AI in Test Automation: From Locators to Generative AI ( Part 3 ) — © Tung Nguyen de Pixabay

It’s 10:00 AM on a quiet weekday and I’m staring at yet another failed test report.

This wasn’t just any test case , it was one I had reviewed and debugged last week after some UI changes. And now it had mysteriously failed. Again…

The error? Visibily there is no error.

What should have been: this text should be displayed on the welcome screen:
“Bienvenue à bord de l’application my-app-name!”

I made a look on the app screenshot and the text was correctly displayed.. there was no issue:

Screenshot from the author mobile — for confidentiality issues the app name has been blurred

I decided to make a look on the Appium XML :

<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" 
value="Bienvenue à bord de l'application&#10;my-app-name !"
enabled="true" visible="false" accessible="true" x="879" y="522"
width="312" height="50" index="7"/>

That little “ &#10; “ — a sneaky newline character — had crept into the XML output…