如何在Jmeter中连接两个字符串(正则表达式)? [英] How can concatenate two strings (regex) in Jmeter?

查看:781
本文介绍了如何在Jmeter中连接两个字符串(正则表达式)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Jmeter登录脚本. 登录时,我需要使用某些参数进行POST: 这是我在Jmeter中执行的操作:

I am working on a Jmeter login script. When I log in, I need to make a POST with certain parameters: This is how I do it in Jmeter:

问题在于,每当我创建gxstate时,如下图所示:

The problem is that whenever I create the gxstate like in the next picture:

我得到的价值是这样的:

the value I get is something like this:

{"OLVIDO_Visible":"0","_EventName":"","_EventGridId":"","_EventRowId":"","FORM_Class":"form-horizontal FormLoginPage","vIDIOMA_Values":"{\"isset\":true,\"s\":\"S\",\"v\":[[\"S\",\"Español\"],[\"E\",\"English\"],[\"P\",\"Portugués\"]]}","vAPPLICATIONCLIENTID":"","GX_FocusControl":"vUSERNAME","GX_AJAX_KEY":"###############################","AJAX_SECURITY_TOKEN":"##################################################################","GX_CMP_OBJS":{},"sCallerURL":"","GX_WEBSOCKET_ID":"3b3c20c2-ffb7-4fe1-8e05-9e32398560df","GX_CLI_NAV":"true","GX_THEME":"WorkWithPlusTheme","GX_RES_PROVIDER":"com.genexus.webpanels.GXResourceProvider"}

与图片中的图片不同,因为它最后缺少此内容:

which is different from the one in the picture because its missing this at the end:

"_MODE":"","Mode":"","IsModified":"1","IsConfirmed":"0"

我尽一切努力将它们串联起来,但是我的解决方案无法正常工作.有关如何执行此操作的任何建议?

I tried everything to concatenate them but my solutions are not working. Any suggestions on how to do this?

推荐答案

如果这是您遇到的问题,请尝试通过此站点改进正则表达式,它对我有很大帮助: https://regex101.com/ 也许正则表达式应该是:GXState:{(.+)"}而不是value ='(.*?)'

Try this site to improve regex if that's the problem in your case, it helped me a lot: https://regex101.com/ Maybe the regex should be : GXState:{"(.+)"} instead of value='(.*?)'

这篇关于如何在Jmeter中连接两个字符串(正则表达式)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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