处理包含文件上传的网络测试时出错
我们使用 MVC2 开发了 Web 应用程序。我正在为我们的网络应用程序中的所有视图录制网络测试。我使用安装在单独机器上的 VS2008 测试版来进行这些网络测试。
我的问题是 - 我记录的网络测试无法查看。此特定视图包含 2 个上传控件。
常见错误是 -
- 请求失败:空路径名不合法。
- 请求失败:在测试上下文中找不到上下文参数“$HIDDEN1.EParamList[0].EParID”
我想在这里提到的一件事是我们使用了 JSon 调用来调用控制器方法。我们这样做是为了避免回发。但我们还没有使用Json调用来进行上传控件。因此,在 webtest 中记录的上传调用中,我可以看到传递给方法的所有其他参数均为空值。
一般来说,我们所有的视图都包含选项卡,例如 view1(view1.aspx) 包含由用户控件 (.ascx) 表示的选项卡。 Telerik 的 tabstrip 用于表示选项卡。对于 json 调用,仅发送方法所需的参数,并且它们也可以在 webtest 中看到。但每当有任何回发调用(如上传)时,webtest 都会显示此特定调用中的所有参数。
We've web application developed using MVC2. I am recording webtests for all views in our web app. I'm using VS2008 test edition installed on separate machine for these webtests.
My problem is - my recorded webtests fail for a view. THis particular view contains 2 upload controls.
Common errors are -
- Request failed: Empty path name is not legal.
- Request failed: Context parameter '$HIDDEN1.EParamList[0].EParID' not found in test context
One thing I want to mention here is that we have used JSon calls to invoke controller methods. We've done this to avoid postbacks. But we have not used Json calls for upload controls. So on upload call recorded in webtest, I can see all other parameters with empty value passed to method.
Generally all our views contain tabs e.g. view1(view1.aspx) contains tabs represented by user controls(.ascx). Telerik's tabstrip is used to represent tabs. For a json call, only required parameters for method are sent and they can be seen in webtest also. But whenever there is any post back call (like upload), webtest shows all parameters in this particular call.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不看到任何代码,很难判断 WebTest 出了什么问题。
我以前没有见过这个特定的错误消息,所以我只能猜测消息的含义(所以我可能是错的)。我的建议是检查导致该错误的请求的发布参数,并检查“文件上传”节点的属性。可能是该参数中存在空白文件路径。
这是很常见的消息。这意味着当前请求引用的上下文参数丢失。如果隐藏字段“1”的提取规则不正确,就会发生这种情况。如果您向后检查所有执行响应,您可能会发现(现在不记得名称,但我认为它称为详细信息)失败的提取规则。修正该规则应该可以解决第二个问题。
我正在处理 WebTest 录制以及您可能感兴趣的增强指南。
谢谢,
马切伊
It is hard to tell what can be wrong with your WebTest without seeing any code.
I haven't seen this particular error message before so I can only guess what it means by the massage (so I could be wrong). My suggestion would be to check post parameters of the request which is causing that error and check properties of the "File Upload" node. It could be that there is blank file path in that parameter.
This is quite common message. It means that the context parameter which current request is referencing is missing. This will happen if the extraction rule for hidden field "1" is incorrect. If you inspect all execution responses going backwards you will probably find (can't remember the name now but I think it is called details) failed extraction rule. Fixing that rule should solve the second problem.
I'm working on the WebTest recording and enhancing guide which might be of interest to you.
Thanks,
Maciej