New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using cookie data #664
Comments
I'm guessing this is not a one time thing, and you want to automate it. |
I have the same problem. I need to extract the session ID as well as authentication token from cookie. |
Hey everyone, sorry for the late response. I've actually had some progress on this issue, but it has created another issue. We were able to hard code a kind of HTML scrape that would pull the Session ID and assign it as a variable, which is then used in tandem with the Password field to hash the Basic Auth and allow us to continue our testing. We've found this method works every time in the Collection Runner but fails in Newman. Here is the code we used: var index1 = responseBody.indexOf("SID__="); |
I am trying to accomplish pretty much the same thing. I send a post request and in the response body to that request I get some values which I need, but there is a value returned in a cookie that I also need which is a session id . The session id I want to store in an environment variable so that I can chain a set of request together for automation purposes through newman. I am sure there should be a way to parse the information out of the cookie but I am not sure how to do this through postman/jetpacks. Suggestions? |
Can someone please update the best solution here?? |
@ejohnson-spritz @mverma-va With the Interceptor on, you should have access to the cookies in the test script - postman.getResponseCookie(cookieName). Check https://www.getpostman.com/docs/jetpacks_sandbox and http://blog.getpostman.com/2014/11/28/using-the-interceptor-to-read-and-write-cookies/. |
Justin Hooks • 20 hours ago
I’ve been using Postman and Newman to great success recently,
but have come upon a big stumbling block. I'm on a software QA team in Houston,
Texas, and I really need to set a website session ID, stored in a cookie, as an
environment variable for a collection of GET requests I'm working with. I’ve
downloaded the Interceptor plugin and I thought it would accomplish what I
need, but I’m having some difficulty. I need the environment variable from the
cookie to be used in my Postman Auth headers when I run the collection. Is it
possible to capture the session ID from the cookie like this? I'd appreciate
any help. thanks!
The text was updated successfully, but these errors were encountered: