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
getting list of contexts is no longer working #101
Comments
Can you give the logs for the undefined problem with the latest code? That should not happen. |
@imurchie sorry it's my typo.. so I am still hitting the previous issue: Could not connect to a valid app after 20 tries. /Users/mhu/.rvm/gems/ruby-2.2.1/gems/selenium-webdriver-2.53.4/lib/selenium/webdriver/remote/response.rb:70:in |
Some more updates.. so it turns out that the issue happens only when appium driver is launched with udid capability: so for an example, this works: desired_caps = {
caps: {
platformName: 'iOS',
automationName:'xcuitest',
deviceName: 'iPhone 6',
platformVersion: '9.3',
app: APP_PATH
},
appium_lib: {
sauce_username: nil, # don't run on Sauce
sauce_access_key: nil
}
} but this DOESN'T work: desired_caps = {
caps: {
platformName: 'iOS',
automationName:'xcuitest',
deviceName: 'iPhone 6',
**udid: 'a defined udid',**
app: APP_PATH
},
appium_lib: {
sauce_username: nil, # don't run on Sauce
sauce_access_key: nil
}
} I won't say it's a major issue, however, it will be nice to be able to specify a udid in case we want to test multiple apps on same device. Also it seems just need an easy fix to populate platformVersion from the device(udid)... Thank you for help! |
Interesting. Ok. I will look into what is going on here. Thanks for the updated information! |
Alrighty. I can reproduce. Working on a solution. |
I've tracked down the issue. It is when the remote debugger does not have a platformVersion. The quick solution is to pass one in in the desired capabilities. I've also created a fix, which gets the pv from the device. Travis is being slow so it will take a little bit of time to get it through the build and into a release. |
|
For some reason I thought we had made platformVersion a required capability? i guess not |
I thought we had, too. But apparently not. |
it works now with the fix..thanks a lot! |
Hi, I am trying to list available contexts (it should have native_app, a UIWebview and a WKWebview), however, I was hitting errors as below:
info MJSONWP Calling XCUITestDriver.getContexts() with args: ["6c7e9549-324e-40f5-8570-7...
dbug XCUITest Executing command 'getContexts'
dbug iOS Getting list of available contexts
dbug iOS Retrieving contexts and views
dbug iOS Selecting by url: false
dbug RemoteDebugger useNewSafari --> false
dbug RemoteDebugger Debugger socket connected to ::1:27753
dbug RemoteDebugger Sending connection key request
dbug RemoteDebugger Sending '_rpc_reportIdentifier:' message to remote debugger
dbug RemoteDebugger Receiving data from remote debugger: '{"__argument":{"WIRSimulatorBuildKey":"13E230","WIRSimulatorProductVersionKey":"9.3","WIRSimulatorNameKey":"iPhone"},"__selector":"_rpc_reportSetup:"}'
dbug RemoteDebugger Received response from socket send: '["iPhone","13E230","9.3"]'
dbug RemoteDebugger Sim name: iPhone
dbug RemoteDebugger Sim build: 13E230
dbug RemoteDebugger Sim platform version: 9.3
dbug RemoteDebugger Receiving data from remote debugger: '{"__argument":{"WIRApplicationDictionaryKey":{"PID:61366":{"WIRApplicationIdentifierKey":"PID:61366","WIRIsApplicationProxyKey":false,"WIRApplicationNameKey":"Salesforce1","WIRApplicationBundleIdentifierKey":"com.salesforce.internal.chatter2","WIRIsApplicationActiveKey":1},"PID:61368":{"WIRApplicationIdentifierKey":"PID:61368","WIRIsApplicationProxyKey":true,"WIRApplicationNameKey":"","WIRApplicationBundleIdentifierKey":"com.apple.WebKit.WebContent","WIRIsApplicationActiveKey":1,"WIRHostApplicationIdentifierKey":"PID:61366"}}},"__selector":"_rpc_reportConnectedApplicationList:"}'
dbug RemoteDebugger Connected to application
dbug RemoteDebugger Selecting application
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
dbug RemoteDebugger Trying out the possible app ids:
ERR! RemoteDebugger Error: Could not connect to a valid app after 20 tries.
ERR! RemoteDebugger at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
ERR! RemoteDebugger at RemoteDebugger.selectApp$ (lib/remote-debugger.js:231:11)
ERR! RemoteDebugger at tryCatch (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! RemoteDebugger at GeneratorFunctionPrototype.invoke as _invoke
ERR! RemoteDebugger at GeneratorFunctionPrototype.prototype.(anonymous function) as next
ERR! RemoteDebugger at invoke (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! RemoteDebugger at enqueueResult (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:185:17)
ERR! RemoteDebugger at new Promise (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/es6.promise.js:201:7)
ERR! RemoteDebugger at AsyncIterator.enqueue (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:184:12)
ERR! RemoteDebugger at AsyncIterator.prototype.(anonymous function) as next
ERR! RemoteDebugger at Object.runtime.async (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:209:12)
ERR! RemoteDebugger at RemoteDebugger.selectApp (lib/remote-debugger.js:261:21)
ERR! RemoteDebugger at XCUITestDriver.callee$0$0$ (lib/commands/context.js:208:35)
ERR! RemoteDebugger at tryCatch (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
ERR! RemoteDebugger at GeneratorFunctionPrototype.invoke as _invoke
ERR! RemoteDebugger at GeneratorFunctionPrototype.prototype.(anonymous function) as next
ERR! RemoteDebugger at GeneratorFunctionPrototype.invoke (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
ERR! RemoteDebugger at run (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/es6.promise.js:108:47)
ERR! RemoteDebugger at /Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/es6.promise.js:119:28
ERR! RemoteDebugger at flush (/Users/mhu/Git/appium/node_modules/appium-xcuitest-driver/node_modules/core-js/library/modules/$.microtask.js:19:5)
ERR! RemoteDebugger at nextTickCallbackWith0Args (node.js:452:9)
ERR! RemoteDebugger at process._tickCallback (node.js:381:13)
ERR! RemoteDebugger [Error: Could not connect to a valid app after 20 tries.]
And today, I got latest code and try to list all contexts, it's showing me "undefined method `contexts' for #Appium::Driver:0x007f7fc8ac8f38 (NoMethodError)"
So what's the right way to list all the contexts now and how shall I switch to the WKWebview context... Thanks for advice!
The text was updated successfully, but these errors were encountered: