首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Appium-chromedriver自定义配置文件

Appium-chromedriver自定义配置文件
EN

Stack Overflow用户
提问于 2021-01-26 23:54:52
回答 1查看 254关注 0票数 0

有没有办法通过appium和chromedriver在android上使用自定义配置文件?在使用chromedriver启动chrome并检查chrome://version后,我尝试将ChromeOptions定义为如下chromeOptions = {'args': ['user-data-dir=/data/user/0/com.android.chrome/app_chrome/']},我看到配置文件路径为/data/data/com.android.chrome/app_chrome/Default,但没有用户登录到chrome。

这是appium启动的日志

代码语言:javascript
复制
[debug] [BaseDriver] Creating session with W3C capabilities: {
[debug] [BaseDriver]   "alwaysMatch": {
[debug] [BaseDriver]     "platformName": "Android",
[debug] [BaseDriver]     "browserName": "Chrome",
[debug] [BaseDriver]     "appium:platformVersion": "11",
[debug] [BaseDriver]     "appium:deviceName": "992AY188TB",
[debug] [BaseDriver]     "appium:chromedriverExecutable": "/Users/chromedriver",
[debug] [BaseDriver]     "appium:automationName": "UiAutomator2",
[debug] [BaseDriver]     "appium:showChromedriverLog": "true",
[debug] [BaseDriver]     "appium:newCommandTimeout": "3000",
[debug] [BaseDriver]     "appium:noReset": "true",
[debug] [BaseDriver]     "appium:fullReset": "false",
[debug] [BaseDriver]     "appium:chromeOptions": {
[debug] [BaseDriver]       "args": [
[debug] [BaseDriver]         "user-data-dir=/data/user/0/com.android.chrome/app_chrome/"
[debug] [BaseDriver]       ]
[debug] [BaseDriver]     }
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "firstMatch": [
[debug] [BaseDriver]     {}
[debug] [BaseDriver]   ]
[debug] [BaseDriver] }
EN

回答 1

Stack Overflow用户

发布于 2021-01-27 01:43:44

你应该使用chromeOptions,通过Appium capabilities添加chrome选项。

请记住,并非所有选项在安卓上都被接受,您可以在代码here中找到受支持的选项

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65904668

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档