Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    IanIsFluent
    @IanIsFluent
    artillery doesn't seem very stable or supported TBH. not sure i'd recommend using it on a new project...
    Trevor Cole
    @djeep
    Bummer.
    Martijn-Verifone
    @Martijn-Verifone
    Hi all, I was excited to try out artillery but after installation I run into an error in a file of artillery. Was wondering if someone could help.
    The error I get is: .nvm/versions/node/v6.9.1/lib/node_modules/artillery/node_modules/csv-parse/lib/index.js:19
    super({...{readableObjectMode: true}, ...opts})
    ^^^
    SyntaxError: Unexpected token ...
    something causes the ... to not be recognized it seems
    jayet
    @jayet
    on Red Hat Enterprise Linux Server release 7.3 (Maipo)
    I have installed node-v10.15.1-linux-x64 and running
    npm install -g artillery
    but it fails :
    npm ERR! request to https://registry.npmjs.org/artillery failed, reason: write EPROTO 140216831190848:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl
    any idea ?
    Rafaela Azevedo
    @rafaelaazevedo
    Hey guys, I am quite new on perf test and would like to understand a bit more about the arrivalRate. I have a script running for one hour and the arrivalRate of 1, so it means that every second a new user is going to be created, but if I want to create 1 user every 30 seconds for example ? what is the arrivalRate that I should use ? Thank you in advance !
    Rafaela Azevedo
    @rafaelaazevedo
    Ah I think I found the answer, I believe I need to use arrivalCount
    Hassy Veldstra
    @hassy
    @jayet looks like it's not specific to Artillery but rather the OS, that looks like an SSL connection error to npm's website
    @Martijn-Verifone you need Node 8.6 or newer
    Hassy Veldstra
    @hassy
    @moonthug you can use qs to set the query string that way: https://artillery.io/docs/http-reference/#query-strings
    @rafaelaazevedo yep, arrivalCount is the way to go :)
    @derrickaubin_gitlab there's a third-party plugin to sign AWS URLs: https://github.com/Nordstrom/artillery-plugin-aws-sigv4
    Hassy Veldstra
    @hassy

    🔊 A short announcement Artillery friends 🔊

    This channel is closing down in favor of a new community discussion board on Spectrum - https://spectrum.chat/artillery-io/general/welcome-to-the-new-artillery-io-community~7e3184eb-aa2b-4b51-bb52-c94d80758f11 Gitter has been useful but Spectrum has a number of advantages, threads & search being the two critical ones. See you all over at https://spectrum.chat/artillery-io 👋

    Duc Tran
    @duc-anh-tran
    I thought that with arrival rate of 20 -> within 5 mins there are 5 60 20 = 6000 scenarios created. I don't quite understand this.
    "phases": [
          {
            "duration": 300,
            "arrivalRate": 20
          }
        ],
        "scenariosCreated": 1200,
        "scenariosCompleted": 1200,
        "requestsCompleted": 1200,
    Martijn-Verifone
    @Martijn-Verifone
    @hassy Thanks for the info Hassy
    Ryan Yim
    @ryyim_twitter
    is it possible to run multiple scenarios from a single .yml file
    ShankarShastri
    @shankarshastri
    Is there a way where I can implement yml as code?
    I meant test code rather than yml
    Sergey
    @vydayko
    Hi
    anybody
    ?
    Sreedevi-91v
    @Sreedevi-91v
    can we use xml request as body for post request in artillery
    ?
    atrekyinee
    @artekyinee_twitter
    hi all, does anyone know how to tell artillery to use inline variables (declared in config) to be used in sequence not by random?
    or it’s possible only via payload?
    tried to add «order» : «sequence» to variables but it did not work (variables taken random)
    Ghost
    @ghost~5cc08ba2d73408ce4fbe92be
    Hi, is it possible with artillery to set query paramaters of socket.io connection as variables from payload .csv files?
    Vitalii Makarets
    @mandelbroo

    @ghost~5cc08ba2d73408ce4fbe92be currently it's not possible https://spectrum.chat/artillery-io/general/is-it-possible-to-have-a-socketio-query-with-random-number-for-each-connect~d01e5441-2640-4527-943d-8c639a320c37

    @hassy "It's not possible at the moment, we'll file it as a bug (query is only evaluated once)"

    ravidio
    @ravidio
    Hello, need a bit of help with artillery. I'm trying to GET a url then parse the response to get all links and loop and get those to. I think what I need is a way to loop over captured regexp values. anyone know if this is possible to achieve?
    jwingo1015
    @jwingo1015
    hey im having a couple of issues. the -log argument doesnt log any info in the console. also i have two request in my yaml file but artillery is only running the first request only. can someone please advise me what i am doing wrong?
    jwingo1015
    @jwingo1015
    Is there any other examples of the requestParam
    Ivan Wong
    @iwong3
    Hey guys! I was wondering if there was any way to generate an artillery report without opening the browser.. artillery report <file>
    eka-putra
    @whitehorse0

    Hi @jwingo1015 have you seen this part ? https://artillery.io/docs/http-reference/#logging

    and if i do, write the test scenario in .yml file, and it's work. https://artillery.io/docs/getting-started/#running-the-test

    eka-putra
    @whitehorse0
    @jwingo1015 and i've a few example
    // login.test.yml
    config:
      processor: './processor.js'
     ...
    scenarios:
      - name: 'Login success'
        flow:
        - post:
            url: '/login'
            beforeRequest: setLoginQuery
            afterResponse: logRes
    
    
    // processor.js
    module.exports = {
    
      setLoginQuery (requestParams, context, ee, next) {
        requestParams.json = {
            username: 'admin',
            password: 'secret'
        }
        return next()
      },
    
      logRes (requestParams, response, context, ee, next) {
        // I use this only for debugging
        console.log(`response body : ${JSON.stringify(response.body)}`)
        return next()
      }
    }
    jwingo1015
    @jwingo1015
    @whitehorse0 thanks
    is there a way to create an array of ids capture from the response body of a loop of request?
    eka-putra
    @whitehorse0

    capture to capturing an array ?
    I don't think it supports it for now.

    And I don't know your reason for having to only use capture :-/

    capturewritten in the documentation The capture element must always have an as attribute which names the value for use in subsequent requests
    which value will also be stored in the variables (as a string)

    and the same thing when we use
    Inline variables https://artillery.io/docs/script-reference/#inline-variables
    or
    function-steps-in-a-flowhttps://artillery.io/docs/http-reference/#function-steps-in-a-flow

    For alternative, we can handle it using "hooks", if you've read this section, https://artillery.io/docs/http-reference/#advanced-writing-custom-logic-in-javascript
    explanation about processor, like the example I gave above.

    jwingo1015
    @jwingo1015
    are we able to loop the request and the function associated with that request?
    eka-putra
    @whitehorse0

    yes you can, have you tried it @jwingo1015?
    just like before, you only have to do the loop.

    I hope I did not misunderstand your question :-/

    jwingo1015
    @jwingo1015
    @whitehorse0 i tried it and it started an endless request even though the count was only 2
    eka-putra
    @whitehorse0
    Could you please give us a demo/sample code to check this?
    jwingo1015
    @jwingo1015
    • loop:
      - function: "ecommerceProdJson"
      - post:
          url: "/ecommerce/stores/{{ store_id }}/products"
      count: 2
          capture:
              json: "$.id"
              as: "product_id"
          body: "{{ productJson }}"
          headers: 
            authorization: "apikey {{ api_key }}"
          expect:
              - statusCode: 200
    eka-putra
    @whitehorse0

    nah not really, I don't think that's good, even though it's not an error, but it will break our expect.
    You must store the id in config.variabel, not from the function process.
    https://artillery.io/docs/script-reference/#inline-variables

    and there are case examples that are a little close
    https://artillery.io/docs/http-reference/#looping-through-an-array

    but this value is set static.

    eka-putra
    @whitehorse0

    if I were, it would be like this

    // product.test.yml
    scenarios:
      - name: 'Fetch product store'
        flow:
        - log: "Get list store"
        - get:
            url: '/ecommerce/stores/'
            afterResponse: extractStoreData
    
        - loop:
            - log: "Get product list of storeIds: {{ $loopElement }}"
            - get:
                url: '/ecommerce/stores/{{ $loopElement }}/products'
                afterResponse: extractProductData
    
            - loop:
                - log: "Get detail product of storeId: {{ storeId }} with productId: {{ $loopElement }}"
                - get:
                    url: '/ecommerce/stores/{{ storeId }}/products/{{ $loopElement }}'
              over: productIds
    
          over: storeIds
    
    // processor.js
    module.exports = {
      extractStoreData (requestParams, response, context, ee, next) {
        if (response.statusCode === 200) {
            const res = JSON.parse(res.body) // if body contain as string we should parse to json object
            const ids = []
    
            // assume we only take 3 store data only
            for (let i = 0; i < 3; i++) {
              const store = res[i];
              ids.push(store.id)
            }
    
            // now we stored in the variables (as an array of string id)
            ctx.vars['storeIds'] = ids
        }
        return next()
      },
    
      extractProductData (requestParams, response, context, ee, next) {
        if (response.statusCode === 200) {
            ...
    
            // now we stored in the variables (as an array of string id)
            ctx.vars['productIds'] = ids
            ctx.vars['storeId'] = ctx.vars['$loopElement']
        }
        return next()
      }
    }

    Thats all variables we can handle on context context.vars['variable-name'].

    jwingo1015
    @jwingo1015
    @whitehorse0 thanks for your reply but i am trying to create multiple products for one store. So i wanted to loop the function that I created that creates different json bodies for the post call.
    eka-putra
    @whitehorse0
    @jwingo1015 oh, sorry i missed it. so you want to post to create product with different json body ?
    I think you only need to create data object in an array with length from number of loops. Then you call the data object from processor base on index of loop,
    you can catch it with ctx.vars['$loopElement'].
    jwingo1015
    @jwingo1015
    yes trying to run a post request with different products around 10 times
    jwingo1015
    @jwingo1015
    also can i put the pass the count to the function that is creating the different json objects?
    the count amount
    eka-putra
    @whitehorse0

    @jwingo1015 yes you can.

    And following from the example case you gave above:

    // product.test.yml
    scenarios:
      - name: 'trying to create multiple products for one store'
        flow:
          - loop:
            - post:
                url: "/ecommerce/stores/{{ store_id }}/products"
                headers:
                  authorization: "apikey {{ api_key }}"
                beforeRequest: "setPostQuery"
                expect:
                  - statusCode: 200
            count: 100
    
    // processor.js
    const data = require('./data.json') // your sample data object in an array
    
    module.exports = {
      setPostQuery (req, ctx, ee, next) {
        // ctx.vars['$loopCount'] is 1 - 100
    
        // so, i recommend to using `$loopElement` to get index of count. ( 0 - 99)
       // because array index starting from 0 in javascript 
        req.json = data[ctx.vars['$loopElement']] 
        return next()
      }
    }

    don't forget to read this: https://artillery.io/docs/http-reference/#looping-through-a-number-of-requests

    joshpzero
    @joshpzero
    Hey guys how do I capture the length of an array of json