I tried searching everywhere and im not getting any solution to this as im stuck on the challenge.
Im getting an assertion error for environment on day 12 challenge
Welcome to the Postman Community!
What do you have in the environment file? From the assertion error it looks like you’re missing a variable.
Have you tried walking through the scenario again, using the documentation as a guide, to ensure you haven’t missed a step?
I got it somewhat the challenge is bugged as I tried adding a none variable and somehow it worked.
Thank you for replying and trying to solve the issue.
You’re welcome, always here to help
Looking at the documentation for Day 12 - It looks like the postman_api_key
variable should also be stored in the environment, which would make that 4
and pass the test.
By added something random, like none
as a variable, it would pass as it’s only checking for the total number of variables rather than the names of them.
pm.test('get single environment', () => {
pm.expect(error).to.equal(null);
pm.expect(response).to.have.property('code', 200);
pm.expect(response).to.have.property('status', 'OK');
pm.expect(response.json().environment.values.length, 'check environment variables').to.equal(4)
pass += 1
});
Can u also help me with day 13 challenge where we have to write a script for average height>100 as I dont know much of Java Script.
Definitely learning some JavaScript would be a great place to get started. Understanding JavaScript is vital when working with Postman test scripts and many other web-related tasks.
To truly harness the power of scripting within Postman and other platforms, it would be beneficial to have a foundational understanding of JavaScript. I’d recommend investing some time in learning the basics of the language. Websites like Codecademy and FreeCodeCamp offer comprehensive and beginner-friendly courses on JavaScript, and they can be a fantastic place to start.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.