Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    PVJ Pavan Kumar
    @pvjpavankumar

    Greetings, I have a scenario, where I need am taking the capture (output) of 1st get, which returns me an Array of Objects and passing it to second get request. I need to loop through these array of objects and make a request to all the object (by passing the value to 2nd GET request). Below is my flow

     flow:
        - get:
             url: "/getList"
             headers:
                 Content-Type: "application/json"
                 Authorization: "{{token}}"
             capture:
                 - json: $.message
                   as: message
                 - json: $.status
                   as: status
                 - json: $.data.pagination.totalRecords
                   as: totalRecords
                 - json: $.data.list
                   as: list
             expect:
                 - statusCode: 200
                 - equals:
                   - "{{message}}"
                   - "List retrived successfully!"
        - log: "getList - {{message}} - {{totalRecords}} - {{list}}"
    
        - loop:
          - get:
              url: "/updateStatus"
              headers:
                  Content-Type: "application/json"
                  Authorization: "{{token}}"
              qs:
                 code: {{$loopElement}}
                 isActive: true
              capture:
                  - json: $.message
                    as: message
                  - json: $.status
                    as: status
              expect:
                  - statusCode: 200
                  - equals:
                    - "{{message}}"
                    - "Status updated successfully!"
                  - equals:
                    - "{{status}}"
                    - true
          - log: "updateStatus - {{$loopElement}}"                    
        over: {{list.name}}

    However, I am unable to get the values of list.name in the loop.

    Neither over: {{list.name}} (OR) over: {{list}} and using the name in loopElement i.e., {{$loopElement.name}} worked.

    Can someone point me what is that I am doing wrong?

    Below is the error with which the invocation is failing.
    .. * GET /api/updateStatus
    ok statusCode 200
    not ok equals Not able to update status, status updated successfully!
    expected: all values to be equal
    got: Not able to update status, status updated successfully!

    G Naga Subrahmanyam
    @GNSubrahmanyam

    how to add dynamic query string to target in ws engine?

    we want to load websocket test our server using 1000 plus user data
    {
    "config": {
    "payload": {
    "path": "./names.csv",
    "fields": ["uniqueSlug", "userName"]
    },
    "target": "wss://some.com/actions?uniqueSlug={{ uniqueSlug }}&userName={{ userName }}",
    "phases": [
    {
    "arrivalRate": 1,
    "duration": 1
    }
    ],
    "ws": {
    "subprotocols": [
    "json"
    ]
    }
    }
    }

    cuber-it
    @cuber-it
    Hi. I'm new artillery user. Looks very good to me, esp. if you are coming from jmeter.
    At the moment I have a strange problem:
    the post runs, eveything is fine, but the get is never activated
    scenarios:
        - name: "create and read airports"
          flow:
            - post:
                name: "create airport"
                url: "/airport"
                json: 
                    airport_name: "{{ ident }}"
                capture:
                    json: "$.results[0].text"
                    as: airport_id
            - get:
                name: "get airport"
                url: "/airport/by_id/{{ airport_id }}"
                capture:
                    json: "$.state"
                    as: "state"
    cuber-it
    @cuber-it
    If I switch get and post, then the get will run, but not the post ...
    David Ankin
    @alexanderankin
    anyone use this with intellij? thanks in advance
    Nadia Pryshchepa
    @jiza4ok
    please can you help me? what are the system requirements to run 1000 flows on socket.io - CPU, memory, network throughput?
    daspiyush
    @daspiyush

    I am getting the error: TypeError: Cannot read property 'capture' of null.
    Please help me understand the issue with my config.

    YAML file:

    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 file:

    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();
    }

    Please help.

    Nikhil M Ranka
    @nikhilranka9_twitter
    Hello Guys,
    Using artillery to test sockets implemented using socket.io.
    Any ideas on how to log the responses in a log file?
    Olubisi Akintunde
    @bakintunde
    Hi everyone, any advice or existing docs out there on how to use artillery to do udp tests?
    Charlie Rogers
    @chubahay
    Hi, does artillery have a limit to the amount of requests you can send in a single flow? My flow seems to stop after 2 requests. Thanks
    obet
    @obet:matrix.org
    [m]
    Greetings folks! Is it possible to have artillery call or leverage some already pre-existing REST API tests written using another library, supertest or fetch, for example?
    adispennette
    @adispennette
    Hello, I am new to artillery and I was attempting to use the artillery-engine-grpc plugin, but I am having some issues.
    1. it seems reletive paths are not supported? (../../some/path/myTest.yaml) Not sure if this is the plugin or the core artillery code
    2. when I move the proto file into the smae directory as the yaml file I get an error about not being able to read a property
      TypeError: Cannot read property '__name' of undefined
       at /usr/local/lib/node_modules/artillery/core/lib/runner.js:389:57
       at Array.find (<anonymous>)
       at /usr/local/lib/node_modules/artillery/core/lib/runner.js:389:43
       at arrayMap (/usr/local/lib/node_modules/artillery/node_modules/lodash/lodash.js:653:23)
       at Function.map (/usr/local/lib/node_modules/artillery/node_modules/lodash/lodash.js:9622:14)
       at runScenario (/usr/local/lib/node_modules/artillery/core/lib/runner.js:385:36)
       at EventEmitter.<anonymous> (/usr/local/lib/node_modules/artillery/core/lib/runner.js:274:7)
       at EventEmitter.emit (node:events:327:20)
       at maybeArrival (/usr/local/lib/node_modules/artillery/core/lib/phases.js:149:12)
       at fn (/usr/local/lib/node_modules/artillery/node_modules/driftless/lib/driftless.js:121:26)
    I have a REST artillery project running just fine
    adispennette
    @adispennette
    So a little blind troublesooting has found that
    1. I needed package and not java_package in my proto file
    2. If I leave the metadata out of the grpc config there is an NPE on line 104 of the grpc index.js
    adispennette
    @adispennette

    Last thing I found is:

    scenarios:
      - name: "Find"
        engine: grpc
        flow:
          - function: “setSymbol” <— this does not seem to be allowed
          - find: [
              symbol: "{{ symbol }}"
            ]

    it results in the following error:

    .   (node:98862) Warning: service.proto not found in any of the include paths 
    (Use `node --trace-warnings ...` to show where the warning was created)
    Started phase 0, duration: 60s @ 08:49:00(-0700) 2021-04-26
    .   /usr/local/lib/node_modules/artillery-engine-grpc/index.js:160
          client[rpcName](args, grpcMetadata, (error, response) => {
                         ^
    
    TypeError: client[rpcName] is not a function
        at /usr/local/lib/node_modules/artillery-engine-grpc/index.js:160:22
        at Array.map (<anonymous>)
        at gRPCRequest (/usr/local/lib/node_modules/artillery-engine-grpc/index.js:157:22)
        at nextTask (/usr/local/lib/node_modules/artillery-engine-grpc/node_modules/async/dist/async.js:4576:27)
        at next (/usr/local/lib/node_modules/artillery-engine-grpc/node_modules/async/dist/async.js:4584:13)
        at /usr/local/lib/node_modules/artillery-engine-grpc/node_modules/async/dist/async.js:321:20
        at init (/usr/local/lib/node_modules/artillery-engine-grpc/index.js:179:14)
        at nextTask (/usr/local/lib/node_modules/artillery-engine-grpc/node_modules/async/dist/async.js:4576:27)
        at Object.waterfall (/usr/local/lib/node_modules/artillery-engine-grpc/node_modules/async/dist/async.js:4587:9)
        at Object.awaitable [as waterfall] (/usr/local/lib/node_modules/artillery-engine-grpc/node_modules/async/dist/async.js:208:32)
    however this seems to be ok:
    scenarios:
      - name: "Find"
        function: "setSymbol"
        engine: grpc
        flow:
          - find: [
              symbol: "{{ symbol }}"
            ]
    I’m not sure how many of these are bugs vs my inexperience but I would appreciate any feed back that anyone could provide.
    adispennette
    @adispennette
    does the artillery grpc plugin have some special folder structure restrictions? I have the proto file and that is puting all the code in a build/generated/ folder. That module is built and then used by another module for creating an artifactory deployable artifact that is used by callers of the service. The current problem though is that the artillery grpc plugin is saying the methods are not found.
    adispennette
    @adispennette
    grpcurl works fine for calling the procedure but artillery grpc plugin can’t seem to find it. artillery grpc plugin consistently throws :
    Error: 12 UNIMPLEMENTED: Method not found: com.proto.AggregatorService/find
    adispennette
    @adispennette
    user error as per the usual, I had the array brakets in the wrong place
    maheshshastri
    @maheshshastri
    Hello all, I am new to this room and artillery too, we have an app that uses AWS-amplify and AWS-Cognito for user authorization and authentication, is it possible to use artillery in this case as the backend is serverless. Any help will be grateful.
    maheshshastri
    @maheshshastri
    Is there any way where I can use the aws-amplify sign-in and signup methods with artillery, any help appreciated. thanks
    Monica Danesa
    @monicadanesa
    hello nice to meet you all , i am facing issue the connection keep opening when we call the requests ( it effect my nat-gateway reach max capacity). may i know any possible to close the connection after we call the request? so it not keep opening. afaik artillery not destroy the virtual users and tcp gonna close if our scenario done. ( but how about if in middle of min we already reach max capacity? )
    1 reply
    nomid0612
    @nomid0612

    Hi
    Can you help with understanding socketio engine connection in artillery
    as example, I send with socketio the following -
    const socket = io('url', {auth: {
    authorisation: "Bearer {token}"
    }});
    console.log(socket.active) - get active here

    but when a try to do it in artillery
    config:
    target: "server"
    socketio:
    query:
    {auth: {
    authorisation: "Bearer token"
    }}
    phases:

    - duration: 1
      arrivalRate: 1

    scenarios:

    • name: "Emit an event"
      engine: socketio
      flow:
      • emit:
        channel: "echo"
        data: "Hello from Artillery"

    I'm getting
    Error: xhr poll error: 1

    Greg Cook
    @kr0ggg
    hello all. I’m looking for an example where I can run 2 POST requests one after the other, having the 2nd one wait until the first is complete and then repeat that flow. any advice is appreciated
    Guilherme Reis
    @guifeliper
    Hello, Does someone know how can I support the .env file instead of on the command line?
    I see that we have a new -v params, but I did not understand how to use it. ( I am trying to avoid a new lib as dotenv-cli)
    Malys
    @malys
    Hi,
    Is there a way to export/import artillery scripts to curl commands (CLI)? THx