ASP.net表单丢失会话上的Jmeter性能测试 [英] Jmeter Performance test on ASP.net form losing session
问题描述
我有一个非常奇怪的问题.我的任务是在一个旧网页上进行一些性能测试(2004年). 使用ASP.net表单创建要测试的模块. 我正在使用Jmeter来完成任务. 我已经使用Chrome扩展(Blazemeter)生成了启动脚本.
Hi guys i have a very strange problem. I am tasked to conduct several performance tests on an old Webpage (2004 - something). The module that is under test is created with ASP.net forms. Im using Jmeter for the task. I have used Chrome extention (Blazemeter) to generate the starting script.
但是发生一个非常奇怪的问题,该表格的所有其他页面都很好,花哨的……除了用于文件上载的页面之外,在该页面上尝试继续(发出POST请求)时,它会丢失会话,您将被重定向到另一个屏幕通用-您是否要继续显示上次会话类型的消息?
But a very strange problem occurs all other pages of the form are fine and dandy... except a page for file upload where upon trying to proceed(Make a POST request) it loses its session and you are redirected to another screen with generic- Would you like to continue last session type of messages appear.
为了调试问题,我在IntelliJ上编写了一个简单的Post请求,执行后一切正常.
In order to try to debug the problem i wrote a simple Post request on IntelliJ and everything works fine when executed.
然后我返回Jmeter并进行与脚本相同的所有操作,但仍然遇到相同的问题.
I then returned to Jmeter and punched in everything identical to the script and i still get the same problem.
然后,我决定尝试使用Jmeter记录代理(以防blazemeter出现故障并错误地分配了一些值),而当我手动浏览表格时,问题似乎出现了! -当我在打开jmeter代理的情况下单击该特定上载表格上的继续时,它将丢失会话,并显示继续上一个会话屏幕".我对记录的简单代理如何使会话混乱感到困惑.我用普通的代理服务器(不是Jmeter代理服务器)进行了尝试,并且一切正常.因此,似乎问题出在Jmeter或某些设置中. 你们有没有遇到过这样的问题,或者对什么可能导致这种行为有一些见识.附加信息:
I then decided to try the Jmeter recording proxy ( in case the blazemeter is faulty and assigns some values incorectly) And while i was manualy browsing the form the problem Appears! - when i click on proceed on that specific upload form with the jmeter proxy turned on, it loses session and it shows the "continue last session screen". And i am baffled as to how a simple proxy that records could mess up the sessions. I tried it with a normal proxy (not the Jmeter one) and everything works. So it seems that the problem is in Jmeter or some settings. Have you guys ever encountered such a problem , or have some insight as to what might cause such behavior. Additional info:
之前我已经处理过ASP.net表单,并且从上一个响应中提取__VIEWSTATE __EVENTARGUMENT和其他两个隐藏变量,并将它们传递给请求.
I have worked on ASP.net form before and i am extracting __VIEWSTATE __EVENTARGUMENT and a couple of other hidden variables from the previous response and passing them to the request.
我将Multipart/form-data用于上传文件模块POST,并正确传递了文件.
I am using the Multipart/form-data for the upload file module POST and passing the file properly.
作为标准,我正在使用KeepAlive和Follow Redirects,但是我尝试了自动重定向或关闭了所有上述功能.
As a standart i am using KeepAlive and Follow Redirects but i have tried Redirect Automatically or all of the above switched off.
在测试计划级别设置了一个Cookie管理器,它正在HC4中运行-兼容性(也尝试了所有其他功能),基于其正常运行的请求.
There is a Cookie Manager set up on Test Plan level and it is working in HC4 - compatibility(tried all others too) based on the requests its working properly.
缓存管理器可容纳5000个元素.
Cache Manager to 5000 elements.
证书似乎已正确导入(对于Jmeter代理).
Certificates seem to be properly imported (for the Jmeter proxy).
在这一点上,我对为何Jmeter拒绝正确行事感到困惑,如果有人可以帮助我,我将非常感激.
I am at this point baffled as to why Jmeter refuses to act properly and i would be very gratefull if someone could help me.
推荐答案
由于我找到了解决方法,大家好我只是发布了一个更新.因此,如果我用blazemeter记录了所有内容(因为jmeter代理不允许我),并且在上载步骤之后,我删除了步骤,只是在关闭了multipart/form tick的情况下在正文中编写了手动请求,而只是将多部分内容写在标题中它似乎有效.我仍然不知道为什么会这样.
Hi guys il just post an update since i found a work around. So if i record everything with blazemeter (since jmeter proxy doesnt allow me) and after on the upload step i delete the steps and just write a manual request in the body with multipart/form tick turned off and just write the multipart stuff in the headers it seems to work. I still have no idea why it behaves this way.
这篇关于ASP.net表单丢失会话上的Jmeter性能测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!