尽管有属性,但未设置 JMeter Cookie
JMeter Cookies not being set despite properties
尝试设置一些基本的 JMeter 运行,以便我可以测试负载性能,但一直在努力获得与 Cookie 相关的基础知识。我的应用程序当前设置的 cookie 没有 domain
,我知道这会导致 JMeter 出现问题。所以我在属性中设置 CookieManager.check.cookies=false
以便它跳过验证,但这没有用。 Cookie 仍未由 Cookie 管理器设置。
其他 cookie 正在工作(比如我的 DNS 提供商添加的 设置 domain
)但我的应用程序发送的关键那些我只能'在进一步的请求中似乎无法使用 Cookie 管理器。
有什么想法吗?
其他注意事项:
- 我设置了
CookieManager.save.cookies=true
- 我重新启动了 JMeter,因此它加载了新属性
- 相同的流程在 Postman 中完美运行
我很感激任何帮助来解决我确信是一个简单的修复。
麦克
找到了答案,post 也会在这里,以防其他人遇到同样的问题。
好像是因为你指向网页的方式不一致,所以我不得不改变这个:
对此:
让它发挥作用。
奇怪,出乎意料,但它解决了。希望这对其他人有帮助。
始终将 Path
与 Server Name or IP
字段相除,
请注意,有时服务器会在特定路径上保存 cookie,
例如,当在同一域中使用不同路径部署多个应用程序时,cookie 仅与特定路径相关
这是一个 valid option:
If you want the cookie to be valid in some other directory, say, http://example.com/special/, you will need to set the path variable to contain the value "/special". If you want the cookie to be valid everywhere on your site, set it to the root of your web directory, that is, "/".
尝试设置一些基本的 JMeter 运行,以便我可以测试负载性能,但一直在努力获得与 Cookie 相关的基础知识。我的应用程序当前设置的 cookie 没有 domain
,我知道这会导致 JMeter 出现问题。所以我在属性中设置 CookieManager.check.cookies=false
以便它跳过验证,但这没有用。 Cookie 仍未由 Cookie 管理器设置。
其他 cookie 正在工作(比如我的 DNS 提供商添加的 设置 domain
)但我的应用程序发送的关键那些我只能'在进一步的请求中似乎无法使用 Cookie 管理器。
有什么想法吗?
其他注意事项:
- 我设置了
CookieManager.save.cookies=true
- 我重新启动了 JMeter,因此它加载了新属性
- 相同的流程在 Postman 中完美运行
我很感激任何帮助来解决我确信是一个简单的修复。
麦克
找到了答案,post 也会在这里,以防其他人遇到同样的问题。
好像是因为你指向网页的方式不一致,所以我不得不改变这个:
对此:
让它发挥作用。
奇怪,出乎意料,但它解决了。希望这对其他人有帮助。
始终将 Path
与 Server Name or IP
字段相除,
请注意,有时服务器会在特定路径上保存 cookie,
例如,当在同一域中使用不同路径部署多个应用程序时,cookie 仅与特定路径相关
这是一个 valid option:
If you want the cookie to be valid in some other directory, say, http://example.com/special/, you will need to set the path variable to contain the value "/special". If you want the cookie to be valid everywhere on your site, set it to the root of your web directory, that is, "/".