cannot parse capability: chromeOptions unrecognized chrome option: androidDeviceSerial
java+appium 切换上下文
用java编写脚本启动appium测试webview的页面
1.首先需要查看APP的webview的版本和Chromedriver的版本是否对应
一般APP的webview都是用的谷歌的内核,所以我们需要关注这两个的版本是否对应
1.先确认webview的版本
1.通过访问chrome://inspect/#devices这个网址来查看APPwebview的版本
然后根据版本号来寻找对应的Chromedriver的版本号
https://blog.csdn.net/weixin_43841082/article/details/88851483可查看到对应版本号
如我的版本是62.0.3202.84 则我需要的Chromedriver的版本是2.35
2.需要在你的APP中将webview的debug模式打开(这个需要求助你们的开发)
2.在你的参数中放入改配置参数
加上(“chromedriverExecutable”, “D:\appium\chromedriver.exe”)参数】
然后我在执行的时候报错
下面展示报错信息:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command.
Original error: An unknown server-side error occurred while processing the command.
Original error: unknown error: cannot parse capability: chromeOptions
from unknown error: unrecognized chrome option: androidDeviceSerial
(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 10.0.18362 x86_64)
(WARNING: The server did not provide any stacktrace information)
Com