无法在我的Android实际设备(6.0.1)上使用Appium(1.4.16.1)打开Chrome 我收到以下错误:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created.
(Original error: An unknown server-side error occurred while processing the command.
(Original error: unknown error: Device abcd is not online (Driver info: chromedriver=2.18.343845
(73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 10.0 x86_64))) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
以下是我的能力:
DesiredCapabilities capabilities = DesiredCapabilities.android();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "abcd");
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Android");
capabilities.setCapability(CapabilityType.VERSION, "6.0.1");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("app", "chrome");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
有什么建议吗?
答案 0 :(得分:0)
deviceName
功能。 abcd
似乎不正确。在命令行中执行adb devices
,它将显示设备的名称。capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
BROWSER_NAME
功能设置为Chrome
答案 1 :(得分:0)
试试这些,
2.打开SDK Manager并根据您的Device Andriod版本更新最新的软件包。
也
从Build Path重新配置所有.jar文件 - >配置构建路径 - >库 - 删除并再次添加所有.jars(如果它是Maven,然后再次编辑/保存POM.xml中的依赖项)。希望它有效!