473,800 Members | 2,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automate web page form submission in C#

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
Nov 16 '05 #1
4 10559
Hi Matt
checkout these links ,they may help

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

Nov 16 '05 #2
mo************@ egdsc.microsoft .com (Mohamoss) wrote in message news:<M7******* *******@cpmsftn gxa10.phx.gbl>. ..
Hi Matt
checkout these links ,they may help

http://it.maconstate.edu/tutorials/A...pnet02-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
Nov 16 '05 #3
Not an easy task, but doing actual posts (forms submissions is relatively
straightforward )...

http://samples.gotdotnet.com/quickst...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

"mparisi" <ml*@parisimedi a.com> wrote in message
news:57******** *************** *@posting.googl e.com...
mo************@ egdsc.microsoft .com (Mohamoss) wrote in message

news:<M7******* *******@cpmsftn gxa10.phx.gbl>. ..
Hi Matt
checkout these links ,they may help

http://it.maconstate.edu/tutorials/A...pnet02-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

Nov 16 '05 #4
Hi Matt:

I wrote an article to do what I think you are looking for:

Screen Scraping, ViewState, and Authentication using ASP.Net
http://odetocode.com/Articles/162.aspx

HTH,

--
Scott
http://www.OdeToCode.com

On 19 Aug 2004 07:46:23 -0700, ml*@parisimedia .com (mparisi) wrote:
w


Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3441
by: ratlhead | last post by:
Hey all, I'm attempting to do some form processing on a server that has register_globals off, however, I've run into a confusing situation and need some help. Basically, the form is a multi-part/form-data form as I have it upload a file in addition to submit a number of other fields, but the error I have occurs even when no upload is done.
6
4345
by: Charles Banas | last post by:
weird subject - i hope more than just one curious regular will hear me out. :) ok, i've got a bit of a big problem, and i need answers as soon as possible. i know this forum is meant for web developers, but is relevant discussion. i'm not OT here unless someone thinks i'm trolling (which i'm not, obviously). then i'll disappear and never show my face again. :P
3
1918
by: Chris Smith | last post by:
Good morning, Is there a good way to use JavaScript to send a form submission, but get back the response as a string, rather than loading it into a page? I could write the code to send the submission via XMLHttpRequest, but that seems hard... especially implementing multipart-encoded form submission such as required for file upload. Ideas?
6
3059
by: brettev | last post by:
World, I work at a university where the professors have a system to input grades for assignments and calculate final grades, which is output to an excel file. they are then required to get on a different system and click radio buttons in a form to input final grades. i would like to automate this by doing some sort of automated form submission that grabs the information from the excel sheet and selects the correct radio button and then...
1
2069
by: morau99 | last post by:
I want to create a "phrase of the day" post to an online language forum I participate in. I would like to automate this process so that I can randomly pull out of a big table a phrase and easily keep track of used phrases and not have to copy and paste over and over. The site requires a login, the HTML source reveals the following relevant lines: <form action="login.pl" method="post"> <input type="hidden" value="/home.pl"...
6
11907
by: Oleg Konovalov | last post by:
Hi, I have a Java/JavaScript GUI application where I perform a lot of long DB operations , which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and clicks again, which created duplicate forcm submission and hence duplicate records. So I am trying to disable the button as soon as it is clicked, and as soon as it's done,
1
2509
by: Homer | last post by:
Hi, I just got a requirement from my HR department to automate their form submission process and integrate it into the Intranet project that I had just completed Phase 1 of. Because of the short time frame that I've been given, a week to be exact, I do not have the luxury to explore it on my own so here are the requirements: 1. Automate the personnel forms that employees use for changing their information, which is currently in pdf...
6
5094
by: Stanimir Stamenkov | last post by:
I have a form without a submit button like: <form name="form1" action="" onsubmit="alert('submit ' + this.name);"> <div> <label>Field 1: <input type="text" name="field1" onchange="alert(this.name + '=' + this.value);"></label></div> <label>Field 2: <input type="text" name="field2" onchange="alert(this.name + '=' + this.value);"></label></div> </form>
0
1841
Thekid
by: Thekid | last post by:
I'm trying to auto send a form submission to a website but it isn't working. I've done this before and it worked but for some reason, using the same basic code, it doesn't seem to submit it. I'm using urllib & urllib2 to open the page and re to parse the info. On the page is a text entry field and a 'submit' button. I've compared the source code of both pages and they appear the same as far as the submission goes. Anything else I can try? I...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.