Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode: UI Automation: waitForValid()

There's a waitForInvalid() but what about a waitForValid() function? For some reason, push/popTimeout doesn't work for me in many cases. Apple?

like image 997
ma11hew28 Avatar asked Feb 05 '26 08:02

ma11hew28


1 Answers

If the element is "valid" but not "visible" that might return too early. This should wait until its visible and valid.

UIATarget.localTarget().pushTimeout(20);
window.navigationBar().name()["Welcome"].withValueForKey(1, "isVisible");
UIATarget.localTarget().popTimeout();

or

UIATarget.localTarget().pushTimeout(20);
window.navigationBar().name().firstWithPredicate("name is 'Welcome' and isVisible == '1'")
UIATarget.localTarget().popTimeout();
like image 196
011 Avatar answered Feb 07 '26 20:02

011



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!