Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
207 views
in Technique[技术] by (71.8m points)

Appium-chromedriver custom profile

Is there a way to use the custom profile on android with appium and chromedriver? I am trying to define the ChromeOptions as follows chromeOptions = {'args': ['user-data-dir=/data/user/0/com.android.chrome/app_chrome/']} After I launch chrome with the use of chromedriver and check the chrome://version I see profile path as /data/data/com.android.chrome/app_chrome/Default and there is no user signed in to chrome.

This is the log for appium starting

[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] }
question from:https://stackoverflow.com/questions/65904668/appium-chromedriver-custom-profile

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You should add chrome options via Appium capabilities, use chromeOptions.

Keep in mind, not all the options are accepted on Android, you can find supported in code here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...