Random error "Could not find any webviews yet, refreshing/retrying", iOS Simulator

Hello !
I have a big problem with Appium and the iOS Simulator.
I play the same test (open the simulator and go to a specific url) over and over on Iphone/Ipad Simulator, with the exact same code and sometimes, this test failed in the beginning, just after the simulator opens.

I’ve got the error :
Unable to pick a platform for the provided browser.
nil was passed to the PageObject constructor instead of a valid browser object

Some days it happens 10% of the time. Some days 90% of the time.

When it happens, I can see that the simulator open itself as normal, goes to the apple.com homepage (like everytime) but instead of going to the url I ask, it refreshes Apple.com 10 or 20 times then I got the error.

In the appium logs, I can see :

warn: Could not find any webviews yet, refreshing/retrying
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: “au.getElementByAccessibilityId(‘ReloadButton’)”
info: [debug] Sending command to instruments: au.getElementByAccessibilityId(‘ReloadButton’)
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__selector":"_rpc_applicationSentListing:","__argument":{“WIRApplicationIdentifierKey”:“PID:1304”,“WIRListingKey”:{“1”:{“WIRPageIdentifierKey”:1,“WIRURLKey”:“about:blank”,“WIRTitleKey”:"",“WIRTypeKey”:“WIRTypeWeb”}}}}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] We don’t appear to have window set yet, ignoring
info: [debug] [INST] 2015-03-24 09:27:08 +0000 Debug: Got new command 6 from instruments: au.getElementByAccessibilityId(‘ReloadButton’)
info: [debug] [INST] 2015-03-24 09:27:08 +0000 Debug: evaluating au.getElementByAccessibilityId(‘ReloadButton’)
info: [debug] [INST] 2015-03-24 09:27:08 +0000 Debug: evaluation finished
info: [debug] [INST] 2015-03-24 09:27:08 +0000 Debug: responding with:
info: [debug] [INST] 2015-03-24 09:27:08 +0000 Debug: Running system command #7: /usr/local/Cellar/node/0.10.36/bin/node /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/bin/command-proxy-client.js /tmp/instruments_sock 2,{“status”:0,“value”:""}…
info: [debug] Socket data received (25 bytes)
info: [debug] Socket data being routed.
info: [debug] Got result from instruments: {“status”:0,“value”:""}
info: [debug] Condition unmet after 156ms. Timing out.
warn: Could not find reload button, continuing
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__selector":"_rpc_applicationSentListing:","__argument":{“WIRApplicationIdentifierKey”:“PID:1304”,“WIRListingKey”:{“1”:{“WIRPageIdentifierKey”:1,“WIRURLKey”:“http://www.apple.com/",“WIRTitleKey”:“Apple”,“WIRTypeKey”:"WIRTypeWeb”}}}}
info: [debug] Remote debugger notified us of a new page listing
info: [debug] We don’t appear to have window set yet, ignoring
info: [debug] [REMOTE] Selecting app PID:1294 (try #1)
info: [debug] [REMOTE] function () { [native code] }
info: [debug] [REMOTE] Sending _rpc_forwardGetListing: message to remote debugger
info: [debug] [REMOTE] {"__argument":{“WIRConnectionIdentifierKey”:“324f6f1d-bd17-4f18-8c5d-4a2baa354253”,“WIRApplicationIdentifierKey”:“PID:1294”},"__selector":"_rpc_forwardGetListing:"}
info: [debug] [REMOTE] Receiving data from remote debugger
info: [debug] [REMOTE] {"__selector":"_rpc_applicationSentListing:","__argument":{“WIRApplicationIdentifierKey”:“PID:1294”,“WIRListingKey”:{}}}
info: [REMOTE] Empty page dictionary received. Trying again.

(and a loop…)

So I really don’t get why, for the exact same test I have this error sometimes (and not a few times). I’ve update Appium (1.3.7 and appium_lib (6.0)), same result. I’m using Ruby.

I’ve tried to run my test 100 times and I see it’s totally random error
I attached the logs when it failed and when it’s ok. (I just cut the very beginning of the logs)

OK Iphone4s Simulator Appium.txt (37.9 KB)
NOK Iphone4s Simulator Appium.txt (191.0 KB)

Thanks a lot if you can help me !

No one has this problem ?
I still have it a lot…
Thanks !

Even I am facing same issue.
With appium 1.3.4 it was working fine but with any higher version it is throwing same exception. After navigating to apple.com it keeps on refreshing the page.

Any help on this please.

Thanks

I’ve try to use Appium 1.3.4 but I still have the same problem with it so I don’t think it comes from Appium version…
I’ve run the same goto 100 times and I have a lot of random error (apple.com refresh…), like 70% NOK.
Very strange.
Thanks !

Any help on this please.

From appium log I got that it keeps on looking for - au.getElementByAccessibilityId(‘ReloadButton’) and on not finding any web view it starts reloading the same page.

Same for me… Refresh and still not finding the webview. Now it happens like 90% of the time…
But what is steange is that on another computer, with same Appium, Appium_lib and Xcode (6.2) version, I don’t have the problem…

I’ve trie with Appium 1.3.4, installed with npm, and this time, it looks like I don’t have this error again !
So, I will continue to use it, but it’s too bad that I have so much trouble with new releases and IOS simulator…

Me too facing the same error.
Xcode 6.3.2 Appium 1.3.7
So solution yet found :frowning: