程序化构建httprequest? [英] Programmatic construction of httprequest?
问题描述
我正在构建一个ASP页面,我想通过编写一个程序来测试
模拟很多用户点击表单上的提交按钮。我假设可以手动构建一个httprequest对象,但是文档更倾向于使用已经存在的对象。我是在正确的轨道上还是
有更简单的方法吗?
在我的情况下,要提交的表格有几百个字段和什么
我想做的是访问一个带有answers的数据库。用于填写这些
字段。然后我可以通过比较源数据库
与我的ASP应用程序创建的内容来验证结果。
感谢您的任何建议/指示...
比尔
I''m constructing an ASP page that I''d like to test by writing a program that
simulates "many" users hitting the submit button on a form. I assume it''s
possible to manually construct an httprequest object, but the docs are more
oriented towards using one that already exists. Am I on the right track or
is there an easier way?
In my case the Form to be submitted has a couple of hundred fields and what
I want to do is access a database with "answers" to use for filling in these
fields. I can then validate the results by comparing the source database
against what my ASP app creates.
Thanks for any suggestions/pointers...
Bill
推荐答案
您要查看的类是WebClient,特别是
UploadValues方法。
可能有自动化工具可以简化你想要做的事情。
" Bill Cohagan" ;写道:
The class that you want to look at is WebClient, specifically the
UploadValues method.
There may be automated tools that will simplify what you''re trying to do.
"Bill Cohagan" wrote:
我正在构建一个ASP页面,我想通过编写一个模拟很多的程序进行测试。用户点击表单上的提交按钮。我认为手动构建一个httprequest对象是可能的,但是文档更倾向于使用已经存在的对象。我是在正确的轨道上还是
有更简单的方法吗?
在我的情况下,提交的表格有几百个字段,我想要做的是使用答案访问数据库用于填写这些领域。然后,我可以通过比较源数据库与我的ASP应用程序创建的内容来验证结果。
感谢您的任何建议/指示...
Bill
I''m constructing an ASP page that I''d like to test by writing a program that
simulates "many" users hitting the submit button on a form. I assume it''s
possible to manually construct an httprequest object, but the docs are more
oriented towards using one that already exists. Am I on the right track or
is there an easier way?
In my case the Form to be submitted has a couple of hundred fields and what
I want to do is access a database with "answers" to use for filling in these
fields. I can then validate the results by comparing the source database
against what my ASP app creates.
Thanks for any suggestions/pointers...
Bill
Bill Cohagan写道:
Bill Cohagan wrote:
我正在构建一个我想要测试的ASP页面写一个模拟很多的程序。用户点击
表单上的提交按钮。我假设可以手动构建一个httprequest
对象,但是文档更倾向于使用已经存在的对象。我是在正确的轨道上还是有更简单的方法?
在我的情况下,要提交的表格有几百个字段
我想要做的是访问一个数据库"答案"用于填写这些领域。然后,我可以通过比较源数据库与我的ASP应用程序创建的内容来验证结果。
感谢您的任何建议/指示......
I''m constructing an ASP page that I''d like to test by writing a
program that simulates "many" users hitting the submit button on a
form. I assume it''s possible to manually construct an httprequest
object, but the docs are more oriented towards using one that already
exists. Am I on the right track or is there an easier way?
In my case the Form to be submitted has a couple of hundred fields
and what I want to do is access a database with "answers" to use for
filling in these fields. I can then validate the results by comparing
the source database against what my ASP app creates.
Thanks for any suggestions/pointers...
>
System.Web.HttpRequest是服务器端类。要创建自己的HTTP
请求,您需要使用System.Net.HttpWebRequest。系统你是建筑物让我想起FIT -
见 http://fit.c2.com/wiki.cgi?WhatsWhat 。
干杯,
-
Joerg Jooss
jo ** *******@gmx.net
System.Web.HttpRequest is a server-side class. To create your own HTTP
requests, you''ll want to use System.Net.HttpWebRequest. The system you''re
building reminds me of FIT --
see http://fit.c2.com/wiki.cgi?WhatsWhat.
Cheers,
--
Joerg Jooss
jo*********@gmx.net
比尔,
As使用HttpWebRequest,这里有一些技术文章:
#WAP带有SSL的ASP.NET Web应用程序的自动化
http://msdn.microsoft.com/msdnmag/is...n/default.aspx
#POSTing ASP.NET数据
http://authors.aspalliance.com/steve...netscrape2.asp
希望也有所帮助。 />
问候,
Steven Cheng
Microsoft在线支持
安全! www.microsoft.com/security
(此帖子按原样提供,不作任何保证,并且不授予
权利。)
在ASP.NET上获取预览whidbey
< a rel =nofollowhref =http://msdn.microsoft.com/asp.net/whidbey/default.aspxtarget =_ blank> http://msdn.microsoft.com/asp.net/whidbey /default.aspx
Hi Bill,
As for using the HttpWebRequest, here ar e some tech articles :
#Test Automation for ASP.NET Web Apps with SSL
http://msdn.microsoft.com/msdnmag/is...n/default.aspx
#POSTing Data with ASP.NET
http://authors.aspalliance.com/steve...netscrape2.asp
Hope also helps.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
这篇关于程序化构建httprequest?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!