How To Fix Common Errors In Postman

How To Fix Common Errors In Postman

In the previous articles on Postman Tutorial, we have covered “How To Generate Advanced HTML Reports, While Using Newman

In this “How To Fix Common Errors In Postman” article, I will be demonstrating how you can implement this concept and get a tight grip over this.

How To Fix Common Errors In Postman

Common Error in Postman 1:

If we have an environment variable as {{url}. We cannot write inside script as pm.sendRequest({{url}}/item/). The syntax {{url}} works only inside the request builder and not in scripts.


Common Error in Postman 2:

If we want to trigger another request from a pre-request script, we can do it by using postman.setNextRequest


Common Error in Postman 3:

If we want to compare already saved variables (eg. Username) with values from another API response, we can use a method.


Common Error in Postman 4:

If we have a script like this:

Sometimes we get the error “ReferenceError: jsonData is not defined” while setting the global variable. To fix this, we need to define jsonData outside the function.

Or we can set the environment or global variable inside the function.

Common Error in Postman 5:

If we want to set a delay while running a collection in Newman, we can use — delay parameter and specify delay in milliseconds.

Common Error in Postman 6:

If Jenkins shows weird characters in the console, it means output is in Unicode format. To fix this, either use View as Plain text option or add following flags: — disable-unicode


Next steps:

Learn “GUID in Postman” in the next tutorial.

Author Bio: This article is written by Harsha Mittal an ISTQB-CTFL Certified Software Test Engineer having 3.5+ years of experience in Software Testing.

Related posts:

Sharing is caring.

Share on facebook
Share on twitter
Share on linkedin

Like This Post?

We have a lot more where that came from?

We only send really good stuff occasionally, promise.

Rajkumar SM

Leave a Comment

Your email address will not be published. Required fields are marked *

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp

Recent Posts:

Scroll to Top
API Testing eBook