swipeWhileNotFound Randomly stopped working

Hi Tom :slight_smile:

a Short story…
I ran a Test suite on Android device yesterday, at mid point the Device battery drained out so I switched to a different Android device and re-ran the same suite.
Unfortunately Tests that previously worked started failing one after the other, I did some investigation and noticed that every time swipeWhileNotFound called the device failed to perform the action thus failing the Tests.
I’ve returned to the previous device (which worked) and got the same results, Tests kept failing :frowning:

I ran the parallel Tests suite for iOS which uses the exact swipeWhileNotFound command just with a different driver and it did work …

I have no idea what went wrong, maybe you can save the situation.

Cheers!

I’ve managed to slightly figure out the problem.

Instrumenting the App revels also hidden elements (which was known to me), I handled this by passing “+onScreen = ‘true’” to the xPath method.
The result was once the hidden element was found due to higher hierarchy and the “onScreen = ‘false’” the test failed, I’m not completely sure why.

What’s your suggestion on handling hidden elements or on the other hand having a strong unique id type ?
or Which one of the type is the strongest “onScreen” , “hidden” , “visible” .

Cheers :slight_smile:

Hi,

We have some methods that allow you to determine the “grace” that onScreen provides

https://docs.experitest.com/display/public/TD/SeeTestAutomation-+SetProperty

you can use it with the executeScript method (or client.setProperty from 11.4)

// set the onScreen parameter to true only if the element is fully visible on the screen
driver.executeScript("client:client.setProperty('element.visibility.level','full'))

I hope this will help :slight_smile:

1 Like