Pass cookie in http GET request jmeter

早过忘川 提交于 2019-12-24 06:07:22

问题


Ideally, my request should be like this:

/oauth2/v1/consent?OCIS_REQ=asdfakdsfjsdfkjdfkjkdf 

Where "asdfakdsfjsdfkjdfkjkdf" is my Cookie

Im passing it as :

/oauth2/v1/consent?${COOKIE_OCIS_REQ}

But my "${COOKIE_OCIS_REQ}" Variable is not getting replaced with the cookie. Though I set the cookie in Header Manager and enabled CookieManager.save.cookies=true in jmeter.properties and passing it in HTTP Header Manager as
Name : Cookie Value : ${COOKIE_OCIS_REQ}

The request is simply going like : GET https://vkon.demo.internal.com:1111/oauth2/v1/consent${COOKIE_OCIS_REQ}

Cookie Data:

asdfakdsfjsdfkjdfkjkdf

Why my Variable is not getting replaced ?? I'm really fed up with this.

I tried passing it a parameter in request, User defined variable Also but no luck!!


回答1:


First, check what all Cookie variables are created by adding Debug Sampler and View Results Tree.

Then run the test and look at the Debug Sampler result in View Results Tree to check the Cookie variables saved as follows:

From the above image, it is clear that COOKIE_NID is created and can be used in other requests using ${COOKIE_NID} syntax.



来源:https://stackoverflow.com/questions/40651902/pass-cookie-in-http-get-request-jmeter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!