I am trying to complete the student expert program. I have completed all the units but when I try to share it using the final request i get this error.
Used query and path parameters | AssertionError: expected [] to have a length above 0 but got 0
@danny-dainton I solved it. Indeed a silly mistake i was using query params instead of path. changed it and all test cases passed. Well, I do not see anything after passing the test. but [11/11] test cases passed am i ready to submit it?
Check the test which is present in the check progress > Test Collection.
pm.test(“Used query and path parameters”, () => {
//first folder should have query
let queryArr = requestArr.filter(value => value.request.url.query).map(value => value.request.url.query);
console.log(queryArr);
pm.expect(queryArr).to.have.length.of.above(0);
//first folder should also have path
let pathArr = requestArr.filter(value => value.request.url.path).map(value => value.request.url.path);
var pathParams = pathArr.flat().filter(p => p.startsWith(':'));
console.log(pathParams);
//pm.expect(pathParams).to.have.length.of.above(0);