Skip to content

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

@raquelgs

Description

@raquelgs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions