Ever since making the update to Safari 12, my automated scripts have been encountering a new error:
SessionNotCreatedError: Request body does not contain required parameter 'capabilities'.
(Interestingly, this error is exclusive to Safari and doesn't manifest in other browsers).
In my javascript webdriver setup, I specify the capabilities with key value pairs like so:
var capabs = {
'browserName' : 'Safari',
'version' : '12.0'
}
browserUnderTest = new webdriver.Builder().
withCapabilities(capabs)
.forBrowser('safari')
.build();
I suspect the issue lies within the safari.js file itself, but I lack the expertise to pinpoint the exact problem. Below is the complete error message for reference:
SessionNotCreatedError: Request body does not contain required parameter 'capabilities'.
at Object.throwDecodedError (/Users/qualit/Documents/autotests/node_modules/selenium-webdriver/lib/error.js:514:15)
at parseHttpResponse (/Users/qualit/Documents/autotests/node_modules/selenium-webdriver/lib/http.js:519:13)
at doSend.then.response (/Users/qualit/Documents/autotests/node_modules/selenium-webdriver/lib/http.js:441:30)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
From: Task: WebDriver.createSession()
at Function.createSession (/Users/qualit/Documents/autotests/node_modules/selenium-webdriver/lib/webdriver.js:769:24)
at Function.createSession (/Users/qualit/Documents/autotests/node_modules/selenium-webdriver/safari.js:253:41)
at createDriver (/Users/qualit/Documents/autotests/node_modules/selenium-webdriver/index.js:170:33)
at Builder.build (/Users/qualit/Documents/autotests/node_modules/selenium-webdriver/index.js:660:16)
at Object.<anonymous> (/Users/qualit/Documents/autotests/K8_autotest.js:354:6)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
If anyone has insights or solutions to resolve this issue, please feel free to share!