我如何使 cookies 值即 ai_user & JMeter 中的 ai_session 是动态的,因为它看起来不同 &每次用户点击主页请求时浏览器中的动态?
每次我执行电子商务网站的主页时,一些 cookie 会出现在请求标头中,每次我们点击 主页请求 时,其中一些具有唯一的值,即 ai_user & ai_session。我想知道每次点击主页请求时如何在 JMeter 中获取这些唯一值。 我通过 blazemeter 记录了测试脚本,它自动将 HTTP CookieManager 中的所有 cookie 记录为用户定义的 cookie,但这些值是硬编码的,我希望它们在浏览器中工作时是动态的。 我已经更改了 jmeter 属性文件中的属性 CookieManager.save.cookies=true 。Jmeter.properties 文件位于 JMeter 的 bin 文件夹中,并在脚本中使用变量 ${COOKIE_ai_user}使用cookie值。 但问题是它的值是静态的我想让它动态,我该怎么做?
Each time I execute home page of ecommerce website, some cookies appear in request header some of them have unique values each time we hit Home request which is ai_user & ai_session. I want to know how do I get those unique values in JMeter for each time I hit home request.
I recorded test script by blaze meter and it automatically recorded all cookies in HTTP CookieManager as a user defined cookies but those values are hard coded I want them dynamic as it works in browser.
I already Change the property CookieManager.save.cookies=true in jmeter properties file.Jmeter.properties file is located in JMeter’s bin folder and use variable ${COOKIE_ai_user} in script to use cookie value.
But issue is its value is static I want to make it dynamic, how can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,它不会那样工作。
因此,当您在以下位置发送 cookie 时的情况第一个请求极不可能发生(除非您模拟返回用户)
添加 HTTP Cookie 管理器,它模拟浏览器的 cookie 存储并自动处理传入的 cookie。
No, it doesn't work that way.
So the situation when you're sending cookies at the very first request is highly unlikely to happen (unless you're simulating a returning user)
It's sufficient to add HTTP Cookie Manager which simulates browser's cookie storage and automatically handles incoming cookies.