Appium切换上下文到Web视图

时间:2016-04-07 03:13:52

标签: android automation appium

我尝试使用APPIUM自动化Android应用程序,但它无法将上下文切换到Web视图。 我发现具有Web视图的活动具有进程属性,我认为这会导致问题。 为证明这一点,我创建了简单的应用程序一个有流程属性,另一个没有。

我使用的是APPIUM GUI 1.4.13和chrome driver 2.21

有人可以提供建议吗?

失败的日志:

info: Chromedriver: Changed state to 'stopped'

error: Chromedriver: Chromedriver exited unexpectedly with code null, signal SIGTERM

warn: Chromedriver for context WEBVIEW_com.linecorp.appiumwebviewsample:account stopped unexpectedly
warn: Chromedriver quit unexpectedly, but it wasn't the active context, ignoring

error: Chromedriver: Error: An error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.4 x86_64))
    at JWProxy.command$ (lib/proxy.js:149:15)
    at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:67:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:294:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:100:21)
    at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/regenerator/runtime.js:136:37)
    at bound (domain.js:254:14)
    at GeneratorFunctionPrototype.runBound (domain.js:267:12)
    at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:89:39)
    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-chromedriver/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:100:28
    at process._tickDomainCallback (node.js:381:11)
 { [Error: An error occurred (Original error: chrome not reachable
  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.4 x86_64))]
  status: 100,
  value: { message: 'chrome not reachable\n  (Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.4 x86_64)' },
  httpCode: 200 }

1 个答案:

答案 0 :(得分:0)

当未设置应用包Desired Capability时,我可以找到类似的消息。
你使用com.android.chrome作为appPackage吗?