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

No WebView Context in "Get Contexts" result #403

Open
yullyayu01 opened this issue Aug 9, 2023 · 3 comments
Open

No WebView Context in "Get Contexts" result #403

yullyayu01 opened this issue Aug 9, 2023 · 3 comments

Comments

@yullyayu01
Copy link

Hi,

I am new to RF and appiumlibray. I run only 2 test steps as:

  1. Open the apk application in iOS simulator (succeeds)
  2. Get Contexts (only NATIVE_APP view)

I am using an ios app with initial native viewcontroller and second view is web view in a native viewcontroller. I assume I should see a WEBVIEW context by Get Contexts command, but there is no as the log result shows below. Without switching to WEBVIEW, it seems no way to interact with elements displayed.

Could somebody tells me why or how to debug it?

..['NATIVE_APP']

Please advise.
Thanks in advance.

@baselalali
Copy link

baselalali commented Aug 30, 2023

Could please provide us the appium logs. Are you sure, that WEB_View pops up by app starting? If yes add appium cap:

autoWebview : true | Move directly into Webview context. Default false | true, false

@tchudobova-cen69317
Copy link

@baselalali @yullyayu01 Hi there! We have encountered a similar issue when accessing iPads. Workaround was to call Get Contexts twice when using an iOS device. However, that should not be necessary.

@yullyayu01
Copy link
Author

@baselalali @tchudobova-cen69317 Hi, I have already called Get Contexts twice when using an iOS device, but the result is the same, WebView still does not detect it. Here, I have attached the Appium log. Thanks

[35m[HTTP]�[39m �[90m{}�[39m
[debug] �[35m[W3C (a8a0118b)]�[39m Calling AppiumDriver.getContexts() with args: ["a8a0118b-c354-4f68-8106-2c149eb3a76a"]
[debug] �[35m[XCUITest]�[39m Executing command 'getContexts'
[debug] �[35m[XCUITest]�[39m Getting list of available contexts
[debug] �[35m[XCUITest]�[39m Retrieving contexts and views
[debug] �[35m[XCUITest]�[39m Selecting by url: false 
�[35m[RemoteDebugger]�[39m Remote Debugger version 8.13.2
[debug] �[35m[RemoteDebugger]�[39m useNewSafari --> false
[debug] �[35m[RemoteDebugger]�[39m Checking which communication style to use (non-Safari on platform version '15.5')
[debug] �[35m[RemoteDebugger]�[39m Platform version equal or higher than '12.2': true
�[35m[RemoteDebugger]�[39m Setting communication protocol: using Target-based communication
[debug] �[35m[RemoteDebugger]�[39m Connecting to remote debugger through unix domain socket: '/private/tmp/com.apple.launchd.HgVsYl7wGM/com.apple.webinspectord_sim.socket'
[debug] �[35m[RemoteDebugger]�[39m Debugger socket connected
[debug] �[35m[RemoteDebugger]�[39m Sending connection key request
[debug] �[35m[RemoteDebugger]�[39m Sending '_rpc_reportIdentifier:' message (id: 0): 'setConnectionKey'
[debug] �[35m[RemoteDebugger]�[39m Sending to Web Inspector took 15ms
[debug] �[35m[RemoteDebugger]�[39m Sending connection key request
[debug] �[35m[RemoteDebugger]�[39m Sending '_rpc_reportIdentifier:' message (id: 2): 'setConnectionKey'
[debug] �[35m[RemoteDebugger]�[39m Sending to Web Inspector took 1ms
[debug] �[35m[RemoteDebugger]�[39m Selecting application
[debug] �[35m[RemoteDebugger]�[39m No applications currently connected.
[debug] �[35m[XCUITest]�[39m No web frames found.
[debug] �[35m[W3C (a8a0118b)]�[39m Responding to client with driver.getContexts() result: ["NATIVE_APP"]
�[35m[HTTP]�[39m �[37m<-- GET /wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a/contexts �[39m�[32m200�[39m �[90m47 ms - 24�[39m
�[35m[HTTP]�[39m �[90m�[39m
�[35m[HTTP]�[39m �[37m-->�[39m �[37mGET�[39m �[37m/wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a/contexts�[39m
�[35m[HTTP]�[39m �[90m{}�[39m
[debug] �[35m[W3C (a8a0118b)]�[39m Calling AppiumDriver.getContexts() with args: ["a8a0118b-c354-4f68-8106-2c149eb3a76a"]
[debug] �[35m[XCUITest]�[39m Executing command 'getContexts'
[debug] �[35m[XCUITest]�[39m Getting list of available contexts
[debug] �[35m[XCUITest]�[39m Retrieving contexts and views
[debug] �[35m[XCUITest]�[39m Selecting by url: false 
[debug] �[35m[RemoteDebugger]�[39m Sending connection key request
[debug] �[35m[RemoteDebugger]�[39m Sending '_rpc_reportIdentifier:' message (id: 4): 'setConnectionKey'
[debug] �[35m[RemoteDebugger]�[39m Sending to Web Inspector took 0ms
[debug] �[35m[RemoteDebugger]�[39m Selecting application
[debug] �[35m[RemoteDebugger]�[39m No applications currently connected.
[debug] �[35m[XCUITest]�[39m No web frames found.
[debug] �[35m[W3C (a8a0118b)]�[39m Responding to client with driver.getContexts() result: ["NATIVE_APP"]
�[35m[HTTP]�[39m �[37m<-- GET /wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a/contexts �[39m�[32m200�[39m �[90m1 ms - 24�[39m
�[35m[HTTP]�[39m �[90m�[39m
�[35m[HTTP]�[39m �[37m-->�[39m �[37mGET�[39m �[37m/wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a/contexts�[39m
�[35m[HTTP]�[39m �[90m{}�[39m
[debug] �[35m[W3C (a8a0118b)]�[39m Calling AppiumDriver.getContexts() with args: ["a8a0118b-c354-4f68-8106-2c149eb3a76a"]
[debug] �[35m[XCUITest]�[39m Executing command 'getContexts'
[debug] �[35m[XCUITest]�[39m Getting list of available contexts
[debug] �[35m[XCUITest]�[39m Retrieving contexts and views
[debug] �[35m[XCUITest]�[39m Selecting by url: false 
[debug] �[35m[RemoteDebugger]�[39m Sending connection key request
[debug] �[35m[RemoteDebugger]�[39m Sending '_rpc_reportIdentifier:' message (id: 6): 'setConnectionKey'
[debug] �[35m[RemoteDebugger]�[39m Sending to Web Inspector took 0ms
[debug] �[35m[RemoteDebugger]�[39m Selecting application
[debug] �[35m[RemoteDebugger]�[39m No applications currently connected.
[debug] �[35m[XCUITest]�[39m No web frames found.
[debug] �[35m[W3C (a8a0118b)]�[39m Responding to client with driver.getContexts() result: ["NATIVE_APP"]
�[35m[HTTP]�[39m �[37m<-- GET /wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a/contexts �[39m�[32m200�[39m �[90m1 ms - 24�[39m
�[35m[HTTP]�[39m �[90m�[39m
�[35m[HTTP]�[39m �[37m-->�[39m �[37mGET�[39m �[37m/wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a/contexts�[39m
�[35m[HTTP]�[39m �[90m{}�[39m
[debug] �[35m[W3C (a8a0118b)]�[39m Calling AppiumDriver.getContexts() with args: ["a8a0118b-c354-4f68-8106-2c149eb3a76a"]
[debug] �[35m[XCUITest]�[39m Executing command 'getContexts'
[debug] �[35m[XCUITest]�[39m Getting list of available contexts
[debug] �[35m[XCUITest]�[39m Retrieving contexts and views
[debug] �[35m[XCUITest]�[39m Selecting by url: false 
[debug] �[35m[RemoteDebugger]�[39m Sending connection key request
[debug] �[35m[RemoteDebugger]�[39m Sending '_rpc_reportIdentifier:' message (id: 8): 'setConnectionKey'
[debug] �[35m[RemoteDebugger]�[39m Sending to Web Inspector took 0ms
[debug] �[35m[RemoteDebugger]�[39m Selecting application
[debug] �[35m[RemoteDebugger]�[39m No applications currently connected.
[debug] �[35m[XCUITest]�[39m No web frames found.
[debug] �[35m[W3C (a8a0118b)]�[39m Responding to client with driver.getContexts() result: ["NATIVE_APP"]
�[35m[HTTP]�[39m �[37m<-- GET /wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a/contexts �[39m�[32m200�[39m �[90m1 ms - 24�[39m
�[35m[HTTP]�[39m �[90m�[39m
�[35m[HTTP]�[39m �[37m-->�[39m �[37mDELETE�[39m �[37m/wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a�[39m
�[35m[HTTP]�[39m �[90m{}�[39m
[debug] �[35m[W3C (a8a0118b)]�[39m Calling AppiumDriver.deleteSession() with args: ["a8a0118b-c354-4f68-8106-2c149eb3a76a"]
[debug] �[35m[BaseDriver]�[39m Event 'quitSessionRequested' logged at 1739171658203 (14:14:18 GMT+0700 (Western Indonesia Time))
�[35m[Appium]�[39m Removing session a8a0118b-c354-4f68-8106-2c149eb3a76a from our master session list
[debug] �[35m[WD Proxy]�[39m Matched '/session/a8a0118b-c354-4f68-8106-2c149eb3a76a' to command name 'deleteSession'
[debug] �[35m[WD Proxy]�[39m Proxying [DELETE /session/a8a0118b-c354-4f68-8106-2c149eb3a76a] to [DELETE http://127.0.0.1:8100/session/0306B2D9-A506-4942-AD8C-B4FCAD32D571] with no body
[debug] �[35m[RemoteDebugger]�[39m Received connected automation availability state: "WIRAutomationAvailabilityAvailable"
[debug] �[35m[RemoteDebugger]�[39m Received connected applications list: 
[debug] �[35m[RemoteDebugger]�[39m Received connected driver list: {}
[debug] �[35m[WD Proxy]�[39m Got response with status 200: {"value":null,"sessionId":null}
�[35m[DevCon Factory]�[39m Releasing connections for EFB4854D-9C69-402A-9592-61EE202A5802 device on any port number
�[35m[DevCon Factory]�[39m Found cached connections to release: ["EFB4854D-9C69-402A-9592-61EE202A5802:8100"]
[debug] �[35m[DevCon Factory]�[39m Cached connections count: 0
[debug] �[35m[XCUITest]�[39m Not clearing log files. Use `clearSystemFiles` capability to turn on.
[debug] �[35m[XCUITest]�[39m Found a remote debugger session. Removing...
[debug] �[35m[RemoteDebugger]�[39m Disconnecting from remote debugger
[debug] �[35m[RemoteDebugger]�[39m Cleaning up listeners
[debug] �[35m[IOSSimulatorLog]�[39m Stopping iOS log capture
[debug] �[35m[BaseDriver]�[39m Event 'quitSessionFinished' logged at 1739171659283 (14:14:19 GMT+0700 (Western Indonesia Time))
[debug] �[35m[W3C (a8a0118b)]�[39m Received response: null
[debug] �[35m[W3C (a8a0118b)]�[39m But deleting session, so not returning
[debug] �[35m[W3C (a8a0118b)]�[39m Responding to client with driver.deleteSession() result: null
�[35m[HTTP]�[39m �[37m<-- DELETE /wd/hub/session/a8a0118b-c354-4f68-8106-2c149eb3a76a �[39m�[32m200�[39m �[90m1080 ms - 14�[39m
�[35m[HTTP]�[39m �[90m�[39m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants