在http GET请求jmeter中传递cookie

编程入门 行业动态 更新时间:2024-10-24 19:29:19
本文介绍了在http GET请求jmeter中传递cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

理想情况下,我的要求应该是这样的:

Ideally, my request should be like this:

/oauth2/v1/consent?OCIS_REQ=asdfakdsfjsdfkjdfkjkdf

其中"asdfakdsfjsdfkjdfkjkdf"是我的Cookie

Where "asdfakdsfjsdfkjdfkjkdf" is my Cookie

我将其传递为:

/oauth2/v1/consent?${COOKIE_OCIS_REQ}

但是我的"${COOKIE_OCIS_REQ}"变量没有被cookie替换. 虽然我在Header Manager中设置了cookie并在jmeter.properties中启用了CookieManager.save.cookies = true并将其作为传递给HTTP Header Manager 名称:Cookie值:${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}

请求就像这样: GET vkon.demo.internal:1111/oauth2/v1 /consent $ {COOKIE_OCIS_REQ}

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

Cookie数据:

asdfakdsfjsdfkjdfkjkdf

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!!

推荐答案

首先,通过添加Debug Sampler和View Results Tree检查创建的所有Cookie variables.

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

然后运行测试,然后在查看结果树"中查看调试采样器"的结果,以检查保存的Cookie变量,如下所示:

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

从上图中可以清楚地看到,已经创建了COOKIE_NID,并且可以使用${COOKIE_NID}语法将其用于其他请求.

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

更多推荐

在http GET请求jmeter中传递cookie

本文发布于:2023-11-26 08:05:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1633305.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:http   jmeter   cookie

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!