在Jmeter中将变量从一个http请求传递到另一个 [英] Passing variable from one http request to another in Jmeter

查看:148
本文介绍了在Jmeter中将变量从一个http请求传递到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须将变量从jmeter中的xpath提取器传递给另一个http请求.
我该怎么办?

I have to pass a variable from an xpath extractor in jmeter to another http request.
How can I do this?

我想在http请求的标头中传递变量.
我已将变量在xpath提取器中另存为LoginToken.
试图以${LoginToken}的形式检索第二个http请求的标头,但不起作用.

I want to pass the variable in header of http request.
I have saved the variable in xpath extractor as LoginToken.
Tried to retrieve in header of second http request as ${LoginToken} but it doesn't work.

推荐答案

  1. 首先确保您的xpath表达式确实返回任何结果.
    将XPath Extractor中的Default Value字段设置为任意值,并使用例如调试采样器,以查看XPath Extractor执行后的LoginToken变量的值.
  2. 如果您使用XPath Extractor解析HTML响应,请确保选中 Use Tidy(tolerant parser)"选项.
  1. Ensure first that your xpath expression really returns any result.
    Set Default Value field in XPath Extractor to any value and use e.g. Debug Sampler to view the value of LoginToken variable after XPath Extractor execution.
  2. If you are using XPath Extractor to parse HTML response ensure that Use Tidy (tolerant parser) option is CHECKED.

这篇关于在Jmeter中将变量从一个http请求传递到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆