本文介绍了“请求的页面遇到错误"在 jmeter 中甚至使用正则表达式提取器捕获变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 jmeter 来记录应用程序的登录流程,当我重新运行它时,有一些请求失败,所以我从早期的响应中获取动态值并将这些值提供给后续请求

I have used jmeter to record login flow of application , when i re run it there are some requests failing so i fetch dynamic values from earlier responses and supplies those values to subsequent requests

我面临一些问题,请求中有状态令牌,但它的格式正在动态变化,因此当我重新运行时,请求会通过一些时间失败

I am facing some issues there is State token in requests but format of this is changing dynamically so because of that when i rerun some time requests are passing some time failing

这里是

失败案例

{"stateToken":"00UaBoYx2D81AIL32Nz9qmUJrIarSv3OgfUdd8FHGSkb"}
{"stateToken":"00C8O4ptx2DcSPEzHrt69zqmEGta9KbjdwywEVdkICku"}
{"stateToken":"00JgMsy7x2DzXDP0gxaeWv4dj8EguFTWtnLxVx2DBKTkIq"}

工作案例

{"stateToken":"00fswJVHKpW7dNhNVK0bRclBBrsuMLHBBevJ8IS1Wz"}
{"stateToken":"00ZVZXpSJn7v3lxNTrEqy1mAGydgroO5apvoTlWH2u"}

我捕获状态令牌的正则表达式是 stateToken":"(.+?)"

My regular expression for capture state token is stateToken":"(.+?)"

这里有什么问题?

第二个问题是 saml,即使 regax 在 regax 测试器中正常工作,中继状态也不起作用,我收到请求的页面遇到错误".在调试采样器中,正在获取和传递这 2 个变量(附上截图)

the second issue is saml,relay state are not working even regax working fine in regax tester , i am getting "An error was encountered with the requested page". in debug sampler those 2 variables are getting and passed ( screenshot is attached )

任何人对以上 2 个问题有任何想法,请提供一些想法来解决这个问题

Anyone have ideas related above 2 issues please give some ideas to sort out this

推荐答案

这听起来像是你的应用程序中的一个错误,我认为不是 JMeter 的问题,大概是由于这些 x2D 字符(可能是 unicode escape)

It sounds like a bug in your application, I don't think it's JMeter issue, presumably it's due to presence of these x2D characters (may be incorrect work of unicode escape)

我不知道您的应用程序期望什么而不是这个 x2D 尝试检查 JavaScript 应用程序代码以查看它对令牌的作用,当您弄清楚这一点时,您可以在 JSR223 预处理器Groovy 语言

I don't know what does your application expect instead of this x2D try to inspect the JavaScript code of the application to see what it does do the tokens, when you figure this out you can replicate this token conversion logic in JSR223 PreProcessor and Groovy language

这篇关于“请求的页面遇到错误"在 jmeter 中甚至使用正则表达式提取器捕获变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 06:52