Issue with waits, app closing automatically

I am using wait until element is visible and contains element. But I don’t know sometime app is closing automatically when on wait step. If i am using sleep instead of wait it is working fine. What could be the possible fixes that can be done here to stop the app closing?

One more question, what is the different between wait until element is visible and wait until page contains element?

1 Like

Hello, i also for is the problem

Little late in response to the initial post (so you’ve probably solved it) but will answer yours in the hope to solve robsonolinger comment.

If your locator is correct then I suspect would have just been as simple as applying a timeout by passing the timeout= after the locator against that keyword, by default the value is none (but I believe there is an overarching default), which could explain why the sleep works if its a much greater value.

Note: The Wait Until Element Is Visible keyword will Fail if the timeout expires before the element is visible.
App closure is what I’d expect, it failed on that element is visible, and then carried out the Teardown.

EDIT just saw your second part (you’ve probably seen the documentation by now), but links to documentation for Arguments and details for each keyword:
Wait Until Element Is Visible
Wait Until Page Contains Element

Wait until Page Contains Element will just allow for the page to be fully loaded before looking for the element, but I wouldn’t quote me on it (happy to be wrong here)

Oh and in addition, is worth noting this keyword and its example usage, it has a default of 5 seconds: Set Appium Timeout which speaks of the importing, I cant link this as its not linkable, but you can search for " Importing" in the documentation, but it spretty much this line:
" timeout is the default timeout used to wait for all waiting actions. It can be later set with Set Appium Timeout."

1 Like

Hopefully, my response above can also solve the problem you’re facing, If not… it would be worth raising a separate post as this is a fairly old one but if you could provide it with as much detail as possible, replicable code snippets… errors returned, etc… the more provided, the easy it may be for someone to help :slight_smile:
Thanks.