1

I get the following error when I try to run the command: artillery run realtime_transcribing_test.yaml:

TypeError: Cannot read property 'capture' of null.

realtime_transcribing_test.yaml:

config:
  target: "ws://localhost:8001/calls/live-calls"
  processor: "./binary-payload.js"
  phases:
    - duration: 60
      arrivalRate: 5
scenarios:
    - engine: "ws"
      flow:
        - send:
          rate: 48000
          format: 1
          language: "en-IN"
          user_id: "Test client"
        - think: 1
        - loop:
          - function: "sendBinaryData"
          - send: "{{payload}}"
          - think: 1
          count: 100

binary-payload.js:

module.exports = {
    sendBinaryData
};

function sendBinaryData(userContext, events, done) {
    navigator.mediaDevices
  .getUserMedia({ audio: true, video: false })
  .then(stream => {
    const mediaRecorder = new MediaRecorder(stream, {
      mimeType: 'audio/webm',
    });

    mediaRecorder.addEventListener('dataavailable', event => {
      if (event.data.size > 0) {
        userContext.vars.payload = event.data;
      }
    });

    mediaRecorder.start(100);
    setTimeout(event => {
        mediaRecorder.stop();
      }, 100);
  });
  return done();
}

Both the files are placed within the same directory. With my current findings this is a very generic error statement thrown by artillery. I have also verified the validity of the YAML file. Please help me understand the issue with my configuration.

Piyush Das
  • 610
  • 1
  • 7
  • 18
  • Here is a link to a screenshot of the error that I am getting: https://drive.google.com/file/d/1ujdVgiv3V4D7Y319UyCZsFnDUeIzvqGI/view?usp=sharing – Piyush Das Nov 20 '20 at 09:53

0 Answers0