[Possible BUG] MJSONWP protocol requires type and ms" and you sent {"script": 1000}
See original GitHub issueHello,
What are you trying to achieve?
I’m using Codeceptjs with webdriverio and browserstack (automate) and I’m facing an issue related with MJSONWP endpoint to fetch the timeouts and makes my test suite to crash.
What do you get instead?
Error: Parameters were incorrect. We wanted "MJSONWP protocol requires type and ms" and you sent {"script":1000}
-- FAILURES:
1) Commit valid answer
"before each" hook: codeceptjs.before for "Commit a valid answer for an explicit commit block":
Parameters were incorrect. We wanted "MJSONWP protocol requires type and ms" and you sent {"script":1000}
rror: Parameters were incorrect. We wanted "MJSONWP protocol requires type and ms" and you sent {"script":1000}
at getErrorFromResponseBody (node_modules/webdriver/build/utils.js:336:12)
at Request._callback (node_modules/webdriver/build/request.js:116:64)
at Request.self.callback (node_modules/request/request.js:185:22)
at Request.EventEmitter.emit (domain.js:441:20)
at Request.<anonymous> (node_modules/request/request.js:1161:10)
at Request.EventEmitter.emit (domain.js:441:20)
at IncomingMessage.<anonymous> (node_modules/request/request.js:1083:12)
Details
-
CodeceptJS version: 2.0.4
-
NodeJS Version: 10
-
Operating System: Mac OS 10.13
-
WebDriverIO 5.6.3
-
Using inside browserstack: appium_version: 1.9.1 (Tried with 1.6.5, 1.7.1, etc…)**
-
Configuration file: What I found interesting is that Inside my config file (codeceptjs config file) I do not specify any timeout option.
exports.config = {
tests: './test_codecept/*.js',
output: './test_codecept/output',
helpers: {
WebDriver: {
host: 'hub.browserstack.com',
path: '/wd/hub',
url: 'http://WEBSITE:8080/renderer',
user: 'xx',
key: 'xx',
browser: 'iphone',
desiredCapabilities: {
'os_version' : '11',
'device' : 'iPhone 8',
'real_mobile' : 'true',
'browserstack.local' : 'true',
'browserstack.debug' : 'true',
'browserstack.networkLogs' : 'true',
'browserstack.appium_version' : '1.9.1',
'browserstack.user' : 'xx',
'browserstack.key' : 'xx'
}
}
}
}
After failing a few times, I tried to specify a timeout option inside the helper like mention in the w3c WebDriver spec
and didn’t work neither, appeared that I was sending an empty object to the sessionId/timeouts
.
timeouts: {
type: 'script',
ms: 1000
}
After that I tried to setup the timeouts like the error message propose: “type” and “ms”, didn’t work neither.
timeouts: {
type: 'script',
ms: 1000
}
Thanks for reading
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:30 (1 by maintainers)
Top GitHub Comments
I did the following patch mechanism to temporarily fix this issue on our side:
Added “postinstall” to the “scripts” objects in the
package.json
:Install “patch-package” via
npm i patch-package --save-dev
Remove the following lines from
node_modules/lib/helper/WebDriver.js
:Run
npx patch-package codeceptjs
.Commit the changes and the new patch file and start running your iOS tests on BrowserStack 😃
@raquelgs : is this issue resolved? I’m facing the same issue in IOS devices, but the same code is working in Android.