Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot switch to Safari page context on iOS 12.2 #12469

Closed
cschabetsberger-micro-focus opened this issue Apr 10, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@cschabetsberger-micro-focus
Copy link

commented Apr 10, 2019

The problem

Since the update to iOS 12.2, I am no longer able to switch into the web context of Safari on iOS Simulators. This was working without any issues for previous iOS releases and it is also working for iOS 12.2 on physical devices (iPhone 6s). Is this a known issue or is there any workaround for this issue?

Environment

  • Appium version (or git revision) that exhibits the issue: 1.12.1 with this pull request applied: appium/appium-xcuitest-driver#918
  • Desktop OS/version used to run Appium: Win10 x64 (Redstone 5)
  • Mobile platform/version under test: iOS 12.2, Xcode 10.2, MacOS Mojave 10.14.4
  • Real device or emulator/simulator: Simulator

Details

After doing some debugging, it looks like that no page dictionary is returned from Safari for the call "_rpc_forwardGetListing" (see the log excerpt below). I also noticed that when Safari opens up on the Simulator, an inspectable tab is found by my desktop Safari but after some time, the tab is no longer inspectable by the desktop Safari either (i.e. the entry under Develop -> Simulator ... gets grayed out; I am not sure if that behavior is related).

Excerpt of the log:

[HTTP] --> GET /wd/hub/session/6bd3963e-5cf1-4efa-b728-bdbc9aeb4f0e/contexts
[HTTP] {}
[debug] [MJSONWP] Calling AppiumDriver.getContexts() with args: ["6bd3963e-5cf1-4efa-b728-bdbc9aeb4f0e"]
[debug] [XCUITest] Executing command 'getContexts'
[debug] [iOS] Getting list of available contexts
[debug] [iOS] Retrieving contexts and views
[debug] [iOS] Selecting by url: false 
[debug] [RemoteDebugger] Selecting application
[debug] [RemoteDebugger] Current applications available:
[debug] [RemoteDebugger]     Application: 'PID:24112'
[debug] [RemoteDebugger]         id: "PID:24112"
[debug] [RemoteDebugger]         isProxy: false
[debug] [RemoteDebugger]         name: "Safari"
[debug] [RemoteDebugger]         bundleId: "com.apple.mobilesafari"
[debug] [RemoteDebugger]         hostId: undefined
[debug] [RemoteDebugger]         isActive: 2
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray:
[debug] [RemoteDebugger]           - id: 1
[debug] [RemoteDebugger]             title: "Appium/welcome"
[debug] [RemoteDebugger]             url: "http://0.0.0.0:49355/welcome"
[debug] [RemoteDebugger]             isKey: false
[debug] [RemoteDebugger]     Application: 'PID:24115'
[debug] [RemoteDebugger]         id: "PID:24115"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:24112"
[debug] [RemoteDebugger]         isActive: 1
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: []
[debug] [RemoteDebugger]     Application: 'PID:24122'
[debug] [RemoteDebugger]         id: "PID:24122"
[debug] [RemoteDebugger]         isProxy: true
[debug] [RemoteDebugger]         name: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         bundleId: "com.apple.WebKit.WebContent"
[debug] [RemoteDebugger]         hostId: "PID:24112"
[debug] [RemoteDebugger]         isActive: 1
[debug] [RemoteDebugger]         isAutomationEnabled: false
[debug] [RemoteDebugger]         pageArray: []
[debug] [RemoteDebugger] Found app id key 'PID:24112' for bundle 'com.apple.mobilesafari'
[debug] [RemoteDebugger] Found separate bundleId 'com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:24115'
[debug] [RemoteDebugger] Found separate bundleId 'com.apple.WebKit.WebContent' acting as proxy for 'com.apple.mobilesafari', with app id 'PID:24122'
[debug] [RemoteDebugger] Trying out the possible app ids: PID:24115, PID:24122
[debug] [RemoteDebugger] Selecting app PID:24115 (try #1 of 20)
[debug] [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to remote debugger (id: 93)
[debug] [RemoteDebugger] **Received response from socket send: '["PID:24115",{}]**'
[debug] [RemoteDebugger] Received page change notice for app 'PID:24115' but the listing has not changed. Ignoring.
[debug] [RemoteDebugger] Empty page dictionary received
[debug] [RemoteDebugger] Error checking application: 'Empty page dictionary received'. Retrying connection
[debug] [RemoteDebugger] Selecting app PID:24122 (try #1 of 20)
[debug] [RemoteDebugger] Sending '_rpc_forwardGetListing:' message to remote debugger (id: 94)
[debug] [RemoteDebugger] Received response from socket send: '["PID:24122",{}]'
[debug] [RemoteDebugger] Received page change notice for app 'PID:24122' but the listing has not changed. Ignoring.
[debug] [RemoteDebugger] Empty page dictionary received
[debug] [RemoteDebugger] Error checking application: 'Empty page dictionary received'. Retrying connection

"_rpc_forwardGetListing" is then sent 20 times and Safari always returns an empty dictionary.

@jlipps

This comment has been minimized.

Copy link
Member

commented Apr 10, 2019

I believe this is a known issue being addressed by @imurchie?

@imurchie

This comment has been minimized.

Copy link
Member

commented Apr 10, 2019

Please provide the full logs, as a link to a gist.

@cschabetsberger-micro-focus

This comment has been minimized.

Copy link
Author

commented Apr 16, 2019

Today I started from scratch, pulled the latest Appium and applied the pull request again. For some reason, I am not able to reproduce this issue anymore :-) I think you can close this issue. Thank you!

@imurchie imurchie closed this Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.