artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
8.03k stars 510 forks source link

TypeError: Cannot read property 'capture' of null #885

Open jwoertink opened 4 years ago

jwoertink commented 4 years ago

I'm trying to test a Rails ActionCable connection, but I'm not sure what config I need to make this work. When I tried this config:

config:
  target: "http://localhost:3000/cable"
  ensure:
    maxErrorRate: 1
  phases:
    - duration: 10
      arrivalRate: 2
  ws:
    query:
      chat_id: "user1"
scenarios:
  - engine: "ws"
    flow:
      - send:
        channel: "ChatChannel"
        data:
          username: "user1"
          body: "hello"
          action: "speak"
      - think: 1

I get this error:

❯ artillery run ./loadtest.yml --output results.json
/Users/jeremywoertink/.config/yarn/global/node_modules/artillery/lib/commands/run.js:319
        (params.capture && params.capture.xpath) ||
                ^

TypeError: Cannot read property 'capture' of null
    at /Users/jeremywoertink/.config/yarn/global/node_modules/artillery/lib/commands/run.js:319:17
    at Array.forEach (<anonymous>)
    at /Users/jeremywoertink/.config/yarn/global/node_modules/artillery/lib/commands/run.js:316:19
    at Array.forEach (<anonymous>)
    at checkIfXPathIsUsed (/Users/jeremywoertink/.config/yarn/global/node_modules/artillery/lib/commands/run.js:315:20)
    at fn (/Users/jeremywoertink/.config/yarn/global/node_modules/async/lib/async.js:746:34)
    at /Users/jeremywoertink/.config/yarn/global/node_modules/async/lib/async.js:1213:16
    at /Users/jeremywoertink/.config/yarn/global/node_modules/async/lib/async.js:166:37
    at /Users/jeremywoertink/.config/yarn/global/node_modules/async/lib/async.js:706:43
    at /Users/jeremywoertink/.config/yarn/global/node_modules/async/lib/async.js:167:37

The artillery docs didn't seem to mention where I set the channel I'm connecting to, or how I send extra data like query params. Is this possible to do?

cedricPoncot commented 3 years ago

Same situation here