Hello,
EDIT: Adding logging
Here is the GET from debugger while inspecting the element.
info: [debug] Responding to client with success: {“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_1”],“sessionId”:“8fc45325-b279-495c-af71-f55f51f3482d”}
info: ← GET /wd/hub/session/8fc45325-b279-495c-af71-f55f51f3482d/contexts 200 3.484 ms - 98 {“status”:0,“value”:[“NATIVE_APP”,“WEBVIEW_1”],“sessionId”:“8fc45325-b279-495c-af71-f55f51f3482d”}
Here is the GET from debugger while running the actual test
info: → GET /wd/hub/session/e8310d71-e8e7-41ed-ac39-7de7f9316e62/context {}
info: [debug] Responding to client with success: {“status”:0,“value”:“NATIVE_APP”,“sessionId”:“e8310d71-e8e7-41ed-ac39-7de7f9316e62”}
info: ← GET /wd/hub/session/e8310d71-e8e7-41ed-ac39-7de7f9316e62/context 200 0.686 ms - 84 {“status”:0,“value”:“NATIVE_APP”,“sessionId”:“e8310d71-e8e7-41ed-ac39-7de7f9316e62”}
Why isn’t the WEBVIEW_1 available once I run the actual test?
Original post:
I’m trying to test my webview application, I cannot seem to detect the webview or webview_1.
Using Appium inspector I can see the webview_1.
When I run the test and try to print out my contexts It’s only printing out NATIVE_APP.
example:
puts available_contexts
NATIVE_APP
I am expecting:
NATIVE_APP
WEBVIEW_1
capabilities = {
'appium-version' => '1.0',
platformName: 'iOS',
deviceName: "iPhone 4s",
platformVersion: '7.1',
app: 'myapp_path',
autoLaunch: true,
newCommandTimeout: 300,
authWebView: true,
autoAcceptAlerts: true,
setWebContentsDebuggingEnabled: true,
locationServicesEnabled: true,
locationServicesAuthorized: true,
bundleId: 'com.mybundle'
}
Appium::Driver.new(caps: capabilities).start_driver
Appium.promote_appium_methods Object
I’ve tried to set_context(“WEBVIEW”) and set_context(“WEBVIEW_1”) without any luck, the css selector isnt supported.
Hope I’ve provided enough info.
Thanks!