ifTrue: not "{{ $environment }}" == "localdev"
ifTrue: not $environment == "localdev"
Greetings! I have a scenario where I make two requests
Now, in report summary there are entries for response times (min, p95, p99, etc). Do these response times
-reflect the times of the one scenario run? Or
-reflect time of every call to endpoint.
I am kind of new to artillery so I am still trying to make sense of the reports, and how can I use it to replace what we are using now. Thanks!
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!
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"
]
}
}
}
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"
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.