chromedriver missing command parameters when trying to start session via terminal

1,051 views
Skip to first unread message

ish...@gmail.com

unread,
May 2, 2019, 9:39:55 AM5/2/19
to ChromeDriver Users
Hi Everyone,

I am trying to create a session using chromedriver and W3C WebDriver specification. The issue that I'm facing is that whenever I try to hit the /session endpoint I get the message "missing command parameters" as a response.

My Capabilities JSON :

{"browserName":chrome,"capabilities":{{"goog:chromeOptions":{"w3c":true,"debuggerAddress":"localhost: 52759"},"platform":MAC,"platformName":MAC,"version":74.0.3729.131}}}

Command & O/P :

ishabbi@Ishs-MacBook-Pro:~$ curl -v -XPOST "http://localhost:9515/session" -d '{"browserName":chrome,"capabilities":{{"goog:chromeOptions":{"w3c":true,"debuggerAddress":"localhost: 52759"},"platform":MAC,"platformName":MAC,"version":74.0.3729.131}}}'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9515 (#0)
> POST /session HTTP/1.1
> Host: localhost:9515
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Length: 170
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 170 out of 170 bytes
< HTTP/1.1 400 Bad Request
< Content-Length:26
< Content-Type:text/plain
< Connection:close
<
* Closing connection 0
missing command parameters


Can anyone help me with the above request? I'm able to create sessions in geckodriver without any issues.

Thanks,
Ish

John Chen

unread,
May 2, 2019, 12:30:47 PM5/2/19
to ish...@gmail.com, ChromeDriver Users
The given JSON string has multiple errors, and isn't valid JSON syntax.
  • Missing property name "alwaysMatch"
  • Missing quotes at multiple places.
  • W3C spec has no capabilities named "platform" or "version"
The following command should work:

curl -v -XPOST "http://localhost:9515/session" -d '{"capabilities":{"alwaysMatch":{"goog:chromeOptions":{"w3c":true,"debuggerAddress":"localhost: 52759"},"platformName":"MAC","browserVersion":"74.0.3729.131"}}}'


--
You received this message because you are subscribed to the Google Groups "ChromeDriver Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromedriver-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ish...@gmail.com

unread,
May 3, 2019, 12:11:25 AM5/3/19
to ChromeDriver Users
On Thursday, May 2, 2019 at 10:00:47 PM UTC+5:30, John Chen wrote:
> The given JSON string has multiple errors, and isn't valid JSON syntax.
> Missing property name "alwaysMatch"Missing quotes at multiple places.W3C spec has no capabilities named "platform" or "version"
Hello John,

I tried the command that you shared. This time I face a different issue, I get the below error repeatedly until the request timeouts :

[1556856404.661][DEBUG]: DevTools HTTP Request: http://localhost:52759/json/version
[1556856404.662][DEBUG]: DevTools HTTP Request failed

Any idea?

John Chen

unread,
May 3, 2019, 12:32:36 PM5/3/19
to ish...@gmail.com, ChromeDriver Users
Most likely you don't have a Chrome listening at port 52759. Did you start Chrome with --remote-debugging-port=52759 on the command line?

Direct communication with ChromeDriver through W3C protocol is not recommended for normal usage. Have you tried using Selenium library from https://www.seleniumhq.org/download/?

ish...@gmail.com

unread,
May 3, 2019, 12:52:46 PM5/3/19
to ChromeDriver Users
I just started the chromedriver and proceeded to execute the HTTP request.

I've been using Selenium library in the day to day needs. I just want to know more on the internals of the WebDriver and if possible contribute. Hence, checking things out :-)

John Chen

unread,
May 3, 2019, 1:01:28 PM5/3/19
to ish...@gmail.com, ChromeDriver Users
By including debuggerAddress in chromeOptions, the command is telling ChromeDriver not to start Chrome, but instead just connect to an existing Chrome on port 52759. Unless you actually have a Chrome listening at that port, the communication won't work.

ish...@gmail.com

unread,
May 3, 2019, 2:21:54 PM5/3/19
to ChromeDriver Users
It works now John! Thanks a lot! :-)
Reply all
Reply to author
Forward
0 new messages