We have 2 APIs which we wanted to test with load impact and the second API is the so-called dynamic target which is built upon the basis of data we get from the response of the first API.
Hence, We want to run this test sequentially. How can we achieve this?
import { check, sleep } from 'k6';
import http from 'k6/http';
export default function() {
let res, res_body, claim_url
res = http.batch([req])
check(res[0], {
"form data OK": function (res) {
console.log(res.status);
claim_url = JSON.parse(res.body)
console.log(claim_url.details.claim_uri)
return false;
}
});
Does grouping of different APIs in a different function help?