Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 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 Answer

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...