Open xxdoc opened 3 years ago
' "capabilities": { ' "firstMatch": { ' "browserName": "chrome", ' "platformName": "any" ' }, ' "alwaysMatch": [ ' { ' "browserName": "chrome", ' "platformName": "any", ' "chromeOptions": { ' "extensions": [], ' "binary": "C:\Users\Administrator\Desktop\loaction\Chrome\1chrome.exe", ' "prefs": { ' "profile": { ' "managed_default_content_settings": { ' "images": 2, ' "popups": 0 ' }, ' "default_content_setting_values": { ' "sound": 2 ' } ' }, ' "download": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontrol", ' "directory_upgrade": true, ' "prompt_for_download": true ' }, ' "savefile": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontrol" ' } ' }, ' "args": [] ' } ' } ' ] ' }, ' "desiredCapabilities": { ' "browserName": "chrome", ' "version": " ", ' "platform": "ANY", ' "chromeOptions": { ' "extensions": [], ' "binary": "C:\Users\Administrator\Desktop\loaction\Chrome\1chrome.exe", ' "prefs": { ' "profile": { ' "managed_default_content_settings": { ' "images": 2, ' "popups": 0 ' }, ' "default_content_setting_values": { ' "sound": 2 ' } ' }, ' "download": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontro\nl", ' "directory_upgrade": true, ' "prompt_for_download": true ' }, ' "savefile": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontrol" ' } ' }, ' "args": [ ' "--disable-infobars", ' "--disable-javascript", ' "--window-size=500,400" ' ] ' } ' } '} ‘==================================================== ’you can add mChromeOption = "{'capabilities':{'alwaysMatch':{'browserName':'chrome','platformName':'any'},'firstMatch':[{'browserName':'chrome'," mChromeOption = mChromeOption & "'loggingPrefs':{'browser':'ALL','driver':'ALL','performance':'ALL'},'platformName':'any','chromeOptions':{'extensions':[], " mChromeOption = mChromeOption & "'perfLoggingPrefs':{'enableNetwork':true},'prefs':{'last_clear_browsing_data_tab':1, " mChromeOption = mChromeOption & "'browser':{'check_default_browser':false,'clear_data':{'browsing_history_basic':true,'cache_basic':true,'cookies_basic':true}}, " mChromeOption = mChromeOption & "'profile':{'managed_default_content_settings':{'images':1,'popups':1},'default_content_setting_values':{'sound':1}}, " mChromeOption = mChromeOption & "'download':{'default_directory':'C:\','directory_upgrade':true,'prompt_for_download':true}, " mChromeOption = mChromeOption & "'savefile':{'default_directory':'C:\'}},'args':[]}}]},'desiredCapabilities':{'browserName':'chrome', " mChromeOption = mChromeOption & "'proxy':{'proxyType':'system','autodetect':'false','httpProxy':'127.0.0.1:8080','ftpProxy':'127.0.0.1:8080','sslProxy':'127.0.0.1:8080','noProxy':'','socksUsername':'cake','socksPassword':'madewithcake'}," mChromeOption = mChromeOption & "'version':'','loggingPrefs': " mChromeOption = mChromeOption & " {'browser':'ALL','driver':'ALL','performance':'ALL'}, " mChromeOption = mChromeOption & "'platform':'ANY','chromeOptions':{'extensions':[],'prefs':{'last_clear_browsing_data_tab':1, " mChromeOption = mChromeOption & "'browser':{'check_default_browser':false,'clear_data':{'browsing_history_basic':true,'cache_basic':true,'cookies_basic':true}}, " mChromeOption = mChromeOption & "'profile':{'managed_default_content_settings':{'images':1,'popups':1},'default_content_setting_values':{'sound':1}}, " mChromeOption = mChromeOption & "'download':{'default_directory':'C:\','directory_upgrade':true,'prompt_for_download':true},'savefile':{'default_directory':'C:\'}}, " mChromeOption = mChromeOption & "'args':['--disable-infobars','--disable-javascript','--window-size=600,500']}}}" Debug.Print Replace$(mChromeOption, "'", Chr(34))
Hi @xxdoc , Sounds nice, thank you! Will you give me URL or something to confirm the spec of browser settings?
https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocolhttps://sites.google.com/a/chromium.org/chromedriver/capabilities
' "capabilities": { ' "firstMatch": { ' "browserName": "chrome", ' "platformName": "any" ' }, ' "alwaysMatch": [ ' { ' "browserName": "chrome", ' "platformName": "any", ' "chromeOptions": { ' "extensions": [], ' "binary": "C:\Users\Administrator\Desktop\loaction\Chrome\1chrome.exe", ' "prefs": { ' "profile": { ' "managed_default_content_settings": { ' "images": 2, ' "popups": 0 ' }, ' "default_content_setting_values": { ' "sound": 2 ' } ' }, ' "download": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontrol", ' "directory_upgrade": true, ' "prompt_for_download": true ' }, ' "savefile": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontrol" ' } ' }, ' "args": [] ' } ' } ' ] ' }, ' "desiredCapabilities": { ' "browserName": "chrome", ' "version": " ", ' "platform": "ANY", ' "chromeOptions": { ' "extensions": [], ' "binary": "C:\Users\Administrator\Desktop\loaction\Chrome\1chrome.exe", ' "prefs": { ' "profile": { ' "managed_default_content_settings": { ' "images": 2, ' "popups": 0 ' }, ' "default_content_setting_values": { ' "sound": 2 ' } ' }, ' "download": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontro\nl", ' "directory_upgrade": true, ' "prompt_for_download": true ' }, ' "savefile": { ' "default_directory": "C:\Users\Administrator\Desktop\chromcontrol" ' } ' }, ' "args": [ ' "--disable-infobars", ' "--disable-javascript", ' "--window-size=500,400" ' ] ' } ' } '} ‘==================================================== ’you can add mChromeOption = "{'capabilities':{'alwaysMatch':{'browserName':'chrome','platformName':'any'},'firstMatch':[{'browserName':'chrome'," mChromeOption = mChromeOption & "'loggingPrefs':{'browser':'ALL','driver':'ALL','performance':'ALL'},'platformName':'any','chromeOptions':{'extensions':[], " mChromeOption = mChromeOption & "'perfLoggingPrefs':{'enableNetwork':true},'prefs':{'last_clear_browsing_data_tab':1, " mChromeOption = mChromeOption & "'browser':{'check_default_browser':false,'clear_data':{'browsing_history_basic':true,'cache_basic':true,'cookies_basic':true}}, " mChromeOption = mChromeOption & "'profile':{'managed_default_content_settings':{'images':1,'popups':1},'default_content_setting_values':{'sound':1}}, " mChromeOption = mChromeOption & "'download':{'default_directory':'C:\','directory_upgrade':true,'prompt_for_download':true}, " mChromeOption = mChromeOption & "'savefile':{'default_directory':'C:\'}},'args':[]}}]},'desiredCapabilities':{'browserName':'chrome', " mChromeOption = mChromeOption & "'proxy':{'proxyType':'system','autodetect':'false','httpProxy':'127.0.0.1:8080','ftpProxy':'127.0.0.1:8080','sslProxy':'127.0.0.1:8080','noProxy':'','socksUsername':'cake','socksPassword':'madewithcake'}," mChromeOption = mChromeOption & "'version':'','loggingPrefs': " mChromeOption = mChromeOption & " {'browser':'ALL','driver':'ALL','performance':'ALL'}, " mChromeOption = mChromeOption & "'platform':'ANY','chromeOptions':{'extensions':[],'prefs':{'last_clear_browsing_data_tab':1, " mChromeOption = mChromeOption & "'browser':{'check_default_browser':false,'clear_data':{'browsing_history_basic':true,'cache_basic':true,'cookies_basic':true}}, " mChromeOption = mChromeOption & "'profile':{'managed_default_content_settings':{'images':1,'popups':1},'default_content_setting_values':{'sound':1}}, " mChromeOption = mChromeOption & "'download':{'default_directory':'C:\','directory_upgrade':true,'prompt_for_download':true},'savefile':{'default_directory':'C:\'}}, " mChromeOption = mChromeOption & "'args':['--disable-infobars','--disable-javascript','--window-size=600,500']}}}" Debug.Print Replace$(mChromeOption, "'", Chr(34))