question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Possible BUG] MJSONWP protocol requires type and ms" and you sent {"script": 1000}

See original GitHub issue

Hello,

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:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:30 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
pablopaulcommented, Jul 30, 2019

I did the following patch mechanism to temporarily fix this issue on our side:

Added “postinstall” to the “scripts” objects in the package.json:

  "scripts": {
    "postinstall": "patch-package"
  },

Install “patch-package” via npm i patch-package --save-dev

Remove the following lines from node_modules/lib/helper/WebDriver.js:

      timeouts: {
        script: 1000, // ms
      },

Run npx patch-package codeceptjs.

Commit the changes and the new patch file and start running your iOS tests on BrowserStack 😃

2reactions
nagamanickammcommented, May 21, 2019

@raquelgs : is this issue resolved? I’m facing the same issue in IOS devices, but the same code is working in Android.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Possible BUG] MJSONWP protocol requires type and ms" and ...
I'm using Codeceptjs with webdriverio and browserstack (automate) and I'm facing an issue related with MJSONWP endpoint to fetch the timeouts ...
Read more >
How to execute test on Browsersatck on iPhone safari?
We wanted {“required”:[“type”,“ms”]} and you sent [“script”]” if i put browser as “iPhone”; Test fail error “Unknown command: setTimeout ...
Read more >
webdriverio/webdriverio - Gitter
Error : Parameters were incorrect. We wanted "MJSONWP protocol requires type and ms" and you sent {"script":1000}. My assumption is that this.
Read more >
How to use the appium-base-driver.PROTOCOLS.MJSONWP ...
To help you get started, we've selected a few appium-base-driver.PROTOCOLS.MJSONWP examples, based on popular ways it is used in public projects.
Read more >
appium_ispair.txt - GitHub
Code signing is required for product type 'UI Testing Bundle' in SDK 'iOS 10.2' ... "MJSONWP protocol requires type and ms" and you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found