Automate web page form submission in C#

  • Thread starter Thread starter mparisi
  • Start date Start date
M

mparisi

I have a responsibility within my testing department to automate the
submission of data on 4 sequential asp pages. Here's the tasks:

1. Sign in
2. Enter form data and submit
3. Enter more form data and submit
4. Upload file and submit all data

The final submission is an accumulation of data from the previous
steps(minus the sign in). Can anyone point me to some sample code or
program that can do this. The program should just run and produce no
output other than what the asp pages output. I'm a beginning C#
programmer so I neeeed help.

Thanks in Advance.
Matt
 
Hi Matt
checkout these links ,they may help

http://it.maconstate.edu/tutorials/ASPNET/ASPNET02/aspnet02-03.aspx
http://www.codeproject.com/aspnet/SubmissionHijack.asp
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Mohamed,

Thanks for the reply. These webpages show how to program ASP.NET
applications. I'm looking for a C# program to manipulate asp web
pages. In other words, let's say there are 4 asp web pages out there
on the internet. I need to start at the first page, enter sign-in
information and click submit, then fill in the fields on the second
page, click submit, fill in the fields on the third page, click submit
and finally, fill in fields and upload file on the final page. This
all has to be done automatically. Thanks!

Matt
 
Not an easy task, but doing actual posts (forms submissions is relatively
straightforward)...

http://samples.gotdotnet.com/quickstart/howto/doc/WebRequests/clientPOST.asp
x

However, your going to have to add in the ability to capture cookies to
maintain your session, and pass the cookie with each post request after you
have authenticated. In theory your going to create a web browser, it may be
easier using one that already exists.

http://www.codeproject.com/csharp/mshtml_automation.asp

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
Back
Top