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 !