Java 适用于android系统的appium 1.4.16';无法识别WEB\u视图上下文

Java 适用于android系统的appium 1.4.16';无法识别WEB\u视图上下文,java,android,webview,appium,Java,Android,Webview,Appium,我有一个带有webview的android活动 但是,appium 1.4.16无法识别此上下文 我的安卓设备是安卓4.2 myAndroidDriver.getContextHandles()==>返回大小为1的列表 我已经阅读了两种解决方案: 1) 设置 2) 设置硒模式 a) “赛琳娜机器人模式”到底意味着什么? 应用程序未使用UIAutomator?这会影响我的其他测试吗 b) 我以前尝试过,但代码执行失败 当我加上: capabilities.setCapability("automa

我有一个带有webview的android活动

但是,appium 1.4.16无法识别此上下文

我的安卓设备是安卓4.2

myAndroidDriver.getContextHandles()
==>返回大小为1的列表

我已经阅读了两种解决方案:

1) 设置

2) 设置硒模式

a) “赛琳娜机器人模式”到底意味着什么? 应用程序未使用UIAutomator?这会影响我的其他测试吗

b) 我以前尝试过,但代码执行失败 当我加上:

capabilities.setCapability("automationName", "Selendroid");

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c /Users/eladb/MyWorkspace/sdk/build-tools/android-4.4/aapt dump badging 
ERROR: no dump file specified
) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.54 seconds
Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44'
System info: host: 'eladb-macbookpro.roam.corp.google.com', ip: '100.105.45.192', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.2', java.version: '1.8.0_25'
Driver info: com.waze.mobileautomation.common.android.MyAndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
尝试:

其中,驱动程序是一个
AndroidDriver
,并且您的
能力类型。浏览器名称设置为
(空)

set contextNames=myAndroidDriver.getContextHandles()//只是为了确保它返回一个集合
。请提供更多关于你的应用程序和活动的详细信息。
capabilities.setCapability("automationName", "Selendroid");

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c /Users/eladb/MyWorkspace/sdk/build-tools/android-4.4/aapt dump badging 
ERROR: no dump file specified
) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.54 seconds
Build info: version: '2.47.1', revision: 'unknown', time: '2015-07-30 11:02:44'
System info: host: 'eladb-macbookpro.roam.corp.google.com', ip: '100.105.45.192', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.2', java.version: '1.8.0_25'
Driver info: com.waze.mobileautomation.common.android.MyAndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
driver.switchTo().window("WEBVIEW");