There's a waitForInvalid() but what about a waitForValid() function? For some reason, push/popTimeout doesn't work for me in many cases. Apple?
Asked
Active
Viewed 7,127 times
2 Answers
6
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();

011
- 81
- 1
- 1
4
When you try to access a particular element directly, there is a default wait time of 5 seconds. You can change the default time as follows.
UIATarget.localTarget().pushTimeout(20);
window.navigationBar().name()["Welcome"];
UIATarget.localTarget().popTimeout();
This will make your instruments wait up to 20 seconds until the name of the navigation bar has changed to "Welcome."

Chris Frederick
- 5,482
- 3
- 36
- 44

Raghunandan R
- 174
- 5
-
Yes, I did this, but it wasn't work. It must've been a UIAutomation issue. – ma11hew28 Sep 06 '11 at 15:22