Appium-chromedriver custom profile - selenium-chromedriver

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] }

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

Related

Log4j2.json ERROR Loggers cannot be configured without a name: arg[2](null)?

This is my log4j2.json file placed inside the resources folder in spring. I dont understand how i can print in both the console and the file at the same time. The console Output is working, the file .html is created but not used
{
"configuration": {
"name": "Default",
"appenders": {
"Console": {
"name": "STDOUT",
"PatternLayout": {
"pattern": "%d [%t] %-5p %c - %m%n"
}
},
"RollingFile": {
"name": "File",
"fileName": "C:/Users/Tiziano/Desktop/LogFile/info-app.html",
"filePattern": "C:/myppInfo-%d{MM-dd-yy-HH-mm-ss}-%i.html.gz",
"HTMLLayout": {
"charset": "UTF-8",
"title": "Info Logs",
"locationInfo": "true"
},
"Policies": {
"SizeBasedTriggeringPolicy": {
"size": "10 MB"
}
},
"DefaultRolloverStrategy": {
"max": "10"
}
}
},
"loggers": {
"logger": {
"level": "info",
"appender-ref": {
"ref": "File"
}
},
"root": {
"level": "info",
"AppenderRef": {
"ref": "STDOUT"
}
}
}
}
}
The error i'm getting in the spring console:
2021-03-02 11:25:51,447 main ERROR Loggers cannot be configured without a name: arg[2](null)
2021-03-02 11:25:51,451 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.config.LoggerConfig for element logger: org.apache.logging.log4j.core.config.ConfigurationException: Arguments given for element logger are invalid org.apache.logging.log4j.core.config.ConfigurationException: Arguments given for element logger are invalid
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.generateParameters(PluginBuilder.java:280)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1002)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:942)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:934)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:552)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:241)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:288)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:618)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:691)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:708)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:153)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
at org.apache.commons.logging.LogAdapter$Log4jLog.<clinit>(LogAdapter.java:155)
at org.apache.commons.logging.LogAdapter$Log4jAdapter.createLog(LogAdapter.java:122)
at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:89)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:67)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:59)
at org.springframework.boot.SpringApplication.<clinit>(SpringApplication.java:203)
at com.example.myapp.MyappApplication.main(MyappApplication.java:10)
2021-03-02 11:25:51,458 main ERROR Null object returned for logger in loggers.
2021-03-02 11:25:52,019 main ERROR Loggers cannot be configured without a name: arg[2](null)
2021-03-02 11:25:52,020 main ERROR Unable to invoke factory method in class org.apache.logging.log4j.core.config.LoggerConfig for element logger: org.apache.logging.log4j.core.config.ConfigurationException: Arguments given for element logger are invalid org.apache.logging.log4j.core.config.ConfigurationException: Arguments given for element logger are invalid
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.generateParameters(PluginBuilder.java:280)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:135)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:1002)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:942)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:934)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:552)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:241)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:288)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:618)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:691)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:708)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.reinitialize(Log4J2LoggingSystem.java:207)
at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:73)
at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60)
at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.initialize(Log4J2LoggingSystem.java:163)
at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:312)
at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:281)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:239)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:216)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:63)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:362)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300)
at com.example.myapp.MyappApplication.main(MyappApplication.java:10)
2021-03-02 11:25:52,021 main ERROR Null object returned for logger in loggers.
The console Output is fine as you can see, what doesnt work is the output in an external file.
2021-03-02 11:25:52,197 [main] INFO com.example.myapp.MyappApplication - No active profile set, falling back to default profiles: default
2021-03-02 11:25:53,153 [main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-03-02 11:25:53,249 [main] INFO org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 81 ms. Found 1 JPA repository interfaces.
2021-03-02 11:25:54,493 [main] INFO org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
2021-03-02 11:25:54,507 [main] INFO org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"]
It looks like you may have a typo - should be AppenderRef instead of appender-ref. See manual for examples - https://logging.apache.org/log4j/2.x/manual/configuration.html#Configuration_with_JSON.

Ansible: json filtering

ill have a role playbook which get json from gitlab
---
- name: Make an API call
uri:
method: GET
url: "https://gitlab.example.com/api/v4/projects/***/repository/files/Dev/raw?ref=master"
headers:
PRIVATE-TOKEN: **************
register: json_var
- name: show json
debug:
msg: "{{json_var}}"
- name: test
debug:
var: json_var.json.plannedrelease
register: release
- name: debug
debug:
msg: "{{ release }}"
but cant get json value to variable, i need only version "1.0" in variable release (from "plannedrelease" : "1.0"), how can i filter it?
Playbook output is:
PLAY [127.0.0.1] ***************************************************************
TASK [Gathering Facts] *********************************************************
ok: [127.0.0.1]
TASK [get_contour_version : Make an API call] **********************************
ok: [127.0.0.1]
TASK [get_contour_version : show json] *****************************************
ok: [127.0.0.1] => {
"msg": {
"cache_control": "max-age=0, private, must-revalidate, no-store, no-cache",
"changed": false,
"connection": "close",
"content_disposition": "inline; filename=\"Dev\"; filename*=UTF-8''Dev",
"content_length": "402",
"content_type": "text/plain; charset=utf-8",
"cookies": {},
"cookies_string": "",
"date": "Tue, 19 Jan 2021 19:42:33 GMT",
"elapsed": 0,
"expires": "Fri, 01 Jan 1990 00:00:00 GMT",
"failed": false,
"json": {
"Created": "12/06/2020 10:11",
"Key": "123",
"Updated": "01/12/2020 11:51",
"contour": "Dev",
"plannedrelease": "1.0",
"…
TASK [get_contour_version : test] **********************************************
ok: [127.0.0.1] => {
"json_var.json.plannedrelease": "1.0"
}
TASK [get_contour_version : debug] *********************************************
ok: [127.0.0.1] => {
"msg": {
"changed": false,
"failed": false,
"json_var.json.plannedrelease": "1.0"
}
}
PLAY RECAP *********************************************************************
127.0.0.1 : ok=5 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
probably i used wrong method for filtering
Have you tried https://docs.ansible.com/ansible/latest/collections/ansible/builtin/set_fact_module.html ? Reading the documentation the following might work:
- name: Save release var
set_fact:
release: "{{ json_var.json.plannedrelease }}"

Selenium 3.1.0 Standalone and chromedriver 2.27

I had Selenium and Chrome working perfectly, but since last week its not working any more. This is what I get:
Caused by: org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '3.1.0', revision: '86a5d70', time: '2017-02-16 07:57:44 -0800'
System info: host: 'Scs-MacBook-Pro.local', ip: 'fe80:0:0:0:8d7:2cd3:84d5:161%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.2', java.version: '1.8.0_51'
Driver info: driver.version: ChromeDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:622)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:178)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:146)
... 14 more
Caused by: java.lang.IllegalStateException: The process has not exited yet therefore no result is available ...
at org.apache.commons.exec.DefaultExecuteResultHandler.getException(DefaultExecuteResultHandler.java:76)
at org.openqa.selenium.os.UnixProcess.checkForError(UnixProcess.java:174)
at org.openqa.selenium.os.CommandLine.checkForError(CommandLine.java:183)
at org.openqa.selenium.remote.service.DriverService.waitUntilAvailable(DriverService.java:179)
at org.openqa.selenium.remote.service.DriverService.start(DriverService.java:168)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:78)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
... 19 more
13:04:18.947 WARN - Exception: The process has not exited yet therefore no result is available ...
13:04:47.978 INFO - Executing: [new session: Capabilities [{acceptSslCerts=true, name=Incart Fi, browserName=chrome, javascriptEnabled=true, platform=ANY}]])
13:04:47.979 INFO - Creating a new session for Capabilities [{acceptSslCerts=true, name=Incart Fi, browserName=chrome, javascriptEnabled=true, platform=ANY}]
Starting ChromeDriver 2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9) on port 29092
Only local connections are allowed.
Now I am wondering why, since I did not change any settings. It starts the safari browser, but there the waitForElement from nightwatch does not work. So can somebody tell me by the error why I got this issue?
{
"_comment": "./selenium-server-standalone-3.0.1.jar",
"_comment2": "/Users/SCMacBook/node_modules/chromedriver/bin/chromedriver",
"src_folders" : ["tests"],
"output_folder" : "reports",
"custom_commands_path" : "",
"custom_assertions_path" : "",
"page_objects_path" : "",
"globals_path" : "",
"selenium" : {
"start_process" : true,
"server_path" : "./selenium-server-standalone-3.1.0.jar",
"log_path" : "",
"port" : 4444,
"cli_args" : {
"webdriver.chrome.driver" : "/Users/SCMacBook/webdriver/chromedriver",
"webdriver.gecko.driver" : "/Users/SCMacBook/webdriver/geckodriver",
"webdriver.firefox.profile" : "nightwatch"
}
},
"test_settings" : {
"default" : {
"silent": true,
"screenshots" : {
"enabled" : true,
"path" : "./pics/"
},
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true
}
},
"firefox" : {
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled" : true,
"acceptSslCerts" : true
}
},
"safari" : {
"desiredCapabilities": {
"browserName": "safari"
}
},
"edge" : {
"desiredCapabilities": {
"platform": "WIN10",
"browserName": "MicrosoftEdge"
}
},
"ie" : {
"desiredCapabilities": {
"platform": "WIN10",
"browserName": "internet explorer",
"acceptSslCerts" : false
}
}
}
}
My solution was pretty simple and I feel espacially dumb. Somehow my /etc/hosts file was changed (MAMP ? My fault ?) and the
127.0.0.1 localhost
part was missing. So the machine couldn't use the localhost as 127.0.0.1
Hope this helps a poor someone someday :/
I also got the same error when running a nightwatch.js test and my problem was also due to a wrong entry to the /etc/hosts file:
0.0.0.0 localhost
The error went away after the above entry was removed.

Chrome failed to start on CentOS using chromedriver2.9

Env: chromedriver 2.9, google-chrome-stable 34, python 2.6, CentOS6.4 final x86_64
I install google-chrome-stable(not chromium) follow install-chrome.sh. It may extract packages from fedoraproject and install those package to /opt/google/chrome/lib. I install chromedriver2.9 follow link. I can run google-chrome and chromedriver manually without error. I install selenium by pip install selenium(selenium 2.41 ). Selenium is installed to /usr/lib/python2.6/site-packages/. Google-chrome installed at this manner seems not allowed to open as root.
When I run code under python console with non root user as follow:
>>> from selenium import webdriver
>>> driver = webdriver.Chrome()
It return error message as follow instead of openning chrome.
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/lib/python2.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 65, in __init__
keep_alive=True)
File "/usr/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py", line 72, in __init__
self.start_session(desired_capabilities, browser_profile)
File "/usr/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py", line 115, in start_session
'desiredCapabilities': desired_capabilities,
File "/usr/lib/python2.6/site-packages/selenium/webdriver/remote/webdriver.py", line 166, in execute
self.error_handler.check_response(response)
File "/usr/lib/python2.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 164, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: u'unknown error: Chrome failed to start: crashed\n (Driver info: chromedriver=2.9.248304,platform=Linux 2.6.32-358.el6.x86_64 x86_64)'
I get log follow linkUnknown error: Chrome failed to start: exited abnormally. There is no solution on that link. What should I do? Thanks.
[0.987][INFO]: COMMAND InitSession {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [ ],
"extensions": [ ]
},
"javascriptEnabled": true,
"platform": "ANY",
"version": ""
},
"sessionId": null
}
[0.987][INFO]: Populating Preferences file: {
"alternate_error_pages": {
"enabled": false
},
"autofill": {
"enabled": false
},
"browser": {
"check_default_browser": false
},
"distribution": {
"import_bookmarks": false,
"import_history": false,
"import_search_engine": false,
"make_chrome_default_for_user": false,
"show_welcome_page": false,
"skip_first_run_ui": true
},
"dns_prefetching": {
"enabled": false
},
"profile": {
"content_settings": {
"pattern_pairs": {
"https://*,*": {
"media-stream": {
"audio": "Default",
"video": "Default"
}
}
}
},
"default_content_settings": {
"geolocation": 1,
"mouselock": 1,
"notifications": 1,
"popups": 1,
"ppapi-broker": 1
},
"password_manager_enabled": false
},
"safebrowsing": {
"enabled": false
},
"search": {
"suggest_enabled": false
},
"translate": {
"enabled": false
}
}
[0.988][INFO]: Populating Local State file: {
"background_mode": {
"enabled": false
},
"ssl": {
"rev_checking": {
"enabled": false
}
}
}
[0.988][INFO]: Launching chrome: /opt/google/chrome/google-chrome --disable-background-networking --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --disable-hang-monitor --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --full-memory-crash-report --ignore-certificate-errors --load-extension=/tmp/.com.google.Chrome.NnyvZ9/internal --logging-level=1 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12775 --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.AtCYvH data:,
[0.989][DEBUG]: DevTools request: http://127.0.0.1:12775/json/version
[0.991][WARNING]: PAC support disabled because there is no system implementation
[1.034][DEBUG]: DevTools request failed
[1.084][DEBUG]: DevTools request: http://127.0.0.1:12775/json/version
[1.085][DEBUG]: DevTools request failed
[1.135][DEBUG]: DevTools request: http://127.0.0.1:12775/json/version
[1.136][DEBUG]: DevTools request failed
.....
.....
[61.022][DEBUG]: DevTools request: http://127.0.0.1:12775/json/version
[61.024][DEBUG]: DevTools request failed
[61.024][INFO]: RESPONSE InitSession unknown error: Chrome failed to start: crashed
[61.025][DEBUG]: Log type 'driver' lost 0 entries on destruction
[61.025][DEBUG]: Log type 'browser' lost 0 entries on destruction
I am confused about those DevTools things, either.
Are you using headless? If so, you will have to specify the headless display through pyvirtualdisplay.
I had the same error (log) when I was running selenium headless without telling selenium to use visual display. After installing pyvirtualdisplay, the following code works for me:
from selenium import webdriver
from pyvirtualdisplay import Display
display = Display(visible=0, size=(800, 600))
display.start()
driver = webdriver.Chrome()
driver.get("http://www.google.com")
print driver.page_source.encode('utf-8')
driver.quit()
display.stop()

Run WebDriver with Chrome Canary?

Is there a way to tell chromedriver (the webdriver implementation within Chrome) to use Canary, Beta or current production chrome?
You can ask ChromeDriver to use a Chrome executable in a non-standard location
ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome.exe");
On Mac OS X, this should be the actual binary, not just the app. e.g., /Applications/Google Chrome.app/Contents/MacOS/Google Chrome.
[via chromedriver Capabilities and Switches]
And the way to do this in theintern is by the following config
capabilities: {
'selenium-version': '2.35.0',
'chrome': {chromeOptions: {'binary': '/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary'}},
},
Also, if you're looking to configure the selenium node directly here's how to pass the configuration in:
{
"capabilities": [
{
"browserName": "chrome",
"platform": "MAC"
},
{
"browserName": "chromeCanary",
"platform": "MAC",
"chromeOptions": {
"binary": "/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary"
},
"maxInstances": 1,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "firefox",
"platform": "MAC"
}
],
"configuration": {
"host": "localhost",
"port": 8989,
"hubPort": 4444,
"hubHost": "localhost"
}
}
It should be this Google Chrome Canary.app and not just Google Chrome.app.
Try this:
options.setBinary("/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary");
ChromeDriver driver = new ChromeDriver(options);