Open jwoertink opened 4 years ago
The original JSON protocol reported a status code. They probably broke that in the WebDriver protocol.
Ah. ok. I'll have to see if there's a way to tell it to use the JsonWire
Probably not. TBH the JSON protocol was small and good. The WebDriver spec seems overly complex, with no benefit, but all direct implementations now use it :-(
Yeah, I looked in to it a little and it's seems way more complicated than it needs to be.
Just ran into this issue as well. Enabling debug logs helped me find the issue and it might help in fixing it here:
REQUEST: POST /session
{"desiredCapabilities" => {browserName: "chrome", platform: "ANY", javascriptEnabled: true, takesScreenshot: true, handlesAlerts: true, databaseEnabled: true, locationContextEnabled: true, applicationCacheEnabled: true, browserConnectionEnabled: true, cssSelectorsEnabled: true, webStorageEnabled: true, rotatable: true, acceptSslCerts: true, nativeEvents: true, chromeOptions: {args: ["no-sandbox", "headless", "disable-gpu"]}}, "requiredCapabilities" => {}}
REQUEST: POST /session
{"desiredCapabilities" => {browserName: "chrome", platform: "ANY", javascriptEnabled: true, takesScreenshot: true, handlesAlerts: true, databaseEnabled: true, locationContextEnabled: true, applicationCacheEnabled: true, browserConnectionEnabled: true, cssSelectorsEnabled: true, webStorageEnabled: true, rotatable: true, acceptSslCerts: true, nativeEvents: true, chromeOptions: {args: ["no-sandbox", "headless", "disable-gpu"]}}, "requiredCapabilities" => {}}
RESPONSE: 200
{"sessionId" => "65044075b66b567f5975a5dcbc3bd362", "status" => 33, "value" => {"message" => "session not created: This version of ChromeDriver only supports Chrome version 77\n (Driver info: chromedriver=77.0.3865.40 (f484704e052e0b556f8030b65b953dce96503217-refs/branch-heads/3865@{#442}),platform=Mac OS X 10.14.6 x86_64)"}}
REQUEST: POST /session/65044075b66b567f5975a5dcbc3bd362/url
{url: "about:blank"}
RESPONSE: 404
{"value" => {"error" => "invalid session id", "message" => "invalid session id", "stacktrace" => "0 chromedriver 0x000000010bbe7f09 chromedriver + 3694345\n1 chromedriver 0x000000010bb74fd3 chromedriver + 3223507\n2 chromedriver 0x000000010b9143e2 chromedriver + 730082\n3 chromedriver 0x000000010b87bacc chromedriver + 105164\n4 chromedriver 0x000000010b8a0f7c chromedriver + 257916\n5 chromedriver 0x000000010b89f30a chromedriver + 250634\n6 chromedriver 0x000000010b89eb47 chromedriver + 248647\n7 chromedriver 0x000000010b867099 chromedriver + 20633\n8 chromedriver 0x000000010bba307f chromedriver + 3412095\n9 chromedriver 0x000000010bbafced chromedriver + 3464429\n10 chromedriver 0x000000010bbafa78 chromedriver + 3463800\n11 chromedriver 0x000000010bb82959 chromedriver + 3279193\n12 chromedriver 0x000000010bbb0548 chromedriver + 3466568\n13 chromedriver 0x000000010bb971b7 chromedriver + 3363255\n14 chromedriver 0x000000010b865390 chromedriver + 13200\n15 libdyld.dylib 0x00007fff7045c3d5 start + 1\n"}}
A solution is to check whether status is defined to keep the existing, then implement the new error hash, and possibly merge the exceptions, to hide the protocol difference to users.
I have this failure, but not sure where it's coming from exactly...
On this line I inspected my
body
, and this it was it returned which doesn't contain a "status" key.Found some docs on that errors object:
https://w3c.github.io/webdriver/#errors