Testing truncated Text Views

I am trying to test an element within a container, that is automatically truncated when the text is too long. I want to validate that the maximum lines of the text element will only be 3.

The UI shows the truncated text with the ellipsis, but when I select on the element on Appium Inspector it shows me the whole text.

I’m looking for a way to test this. I am using Python and Appium.

Here is an example of what the text element looks like inside a container:

UIA2 and xcuitest driver only have access to what the app makes accessible. Perhaps, you could do some visual comparison using opencv or tesseract to figure out if the text is truncated.
Or use grey-box testing, like Espresso driver does.

1 Like