如何在jmeter中的表达式中存在%2F时提取userkey值。

huangapple go评论47阅读模式
英文:

How to extract the userkey value when %2F is present in an expression in jmeter

问题

I am creating a script in JMeter for performance testing!
我正在使用JMeter创建性能测试脚本!

I need to get the userkey form the
response header.
我需要从响应头中获取用户密钥。

As we can see below is the short response for the same:
正如我们所看到的,以下是相同的简短响应:

&Userkey=AMfN%2Fm1wlh

And I tried using the below regex:
我尝试使用以下正则表达式:

Userkey=(.+?)\n
Userkey=(.+?)%2F(.+?)\n
But didn't got solution using post processor, i.e. regular expression extractor in JMeter
但是在使用后处理器,即JMeter中的正则表达式提取器时,没有找到解决方案。

英文:

I am creating a script in JMeter for performance testing!
I need to get the userkey form the
response header.
As we can see below is the short response for the same:
&Userkey=AMfN%2Fm1wlh

And I tried using the below regex:
Userkey=(.+?)\n
Userkey=(.+?)%2F(.+?)\n
But didn't got solution using post processor, i.e. regular expression extractor in JMeter

答案1

得分: 0

尝试以下正则表达式:

Userkey=(.*)

其中:

  • . - 匹配任何字符
  • * - 重复
  • () - 分组

正如您可以在View Results Tree监听器的“RegExp Tester”模式中看到的那样,它会产生一个匹配:

如何在jmeter中的表达式中存在%2F时提取userkey值。

更多信息:

英文:

Try the following regular expression:

Userkey=(.*)

Where:

  • . - matches any character
  • * - repetition
  • () - grouping

As you can see it produces a match in "RegExp Tester" mode of the View Results Tree listener:

如何在jmeter中的表达式中存在%2F时提取userkey值。

More information:

huangapple
  • 本文由 发表于 2023年7月6日 21:49:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76629556.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定