Connecting Tech Pros Worldwide Forums | Help | Site Map

Use code to set values of webform and submit

Mark
Guest
 
Posts: n/a
#1: Nov 18 '05
Hello All
I'm trying to have a .Net app open up a web form, enter values into a text field (given the ID or Name), and submit. Ideally I could program something like
1 - Request Page given UR
2 - Set TextField1.Value = 'Hello
3 - Submit Form (or Click a BtnSubmit

Any ideas how to start with this

Thanks
Mar


Kevin Spencer
Guest
 
Posts: n/a
#2: Nov 18 '05

re: Use code to set values of webform and submit


Your question is somewhat confusing. The purpose of a form is to provide an
interface for a human to be able to input data. If you want your program to
do something with data, it certainly doesn't need a WebForm to do it.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark" <anonymous@discussions.microsoft.com> wrote in message
news:468533AE-F4B2-426B-8EF9-C659C460461B@microsoft.com...[color=blue]
> Hello All,
> I'm trying to have a .Net app open up a web form, enter values into a text[/color]
field (given the ID or Name), and submit. Ideally I could program something
like:[color=blue]
> 1 - Request Page given URL
> 2 - Set TextField1.Value = 'Hello'
> 3 - Submit Form (or Click a BtnSubmit)
>
> Any ideas how to start with this?
>
> Thanks,
> Mark
>[/color]


Mark
Guest
 
Posts: n/a
#3: Nov 18 '05

re: Use code to set values of webform and submit


Hey Kevin
I see what you're saying. Two things (1) This would allow me to make unit tests for WebForms (especially for presentation layer issues), and (2) This would assist with a screen-scraping task I'm trying to do

I know it's an abnormal request... but despite that do you have any insight where to start

Thanks
Mar

----- Kevin Spencer wrote: ----

Your question is somewhat confusing. The purpose of a form is to provide a
interface for a human to be able to input data. If you want your program t
do something with data, it certainly doesn't need a WebForm to do it

--
HTH
Kevin Spence
..Net Develope
Microsoft MV
Big things are made u
of lots of little things

"Mark" <anonymous@discussions.microsoft.com> wrote in messag
news:468533AE-F4B2-426B-8EF9-C659C460461B@microsoft.com..[color=blue]
> Hello All
> I'm trying to have a .Net app open up a web form, enter values into a tex[/color]
field (given the ID or Name), and submit. Ideally I could program somethin
like[color=blue]
> 1 - Request Page given UR
> 2 - Set TextField1.Value = 'Hello
> 3 - Submit Form (or Click a BtnSubmit[color=green]
>> Any ideas how to start with this
>> Thanks[/color]
> Mar
>[/color]
bruce barker
Guest
 
Posts: n/a
#4: Nov 18 '05

re: Use code to set values of webform and submit


you need a hltm parser to parse the web form html.

the easiest way to due this is host IE, and capture its events (page load,
unload, etc). once a page has loaded, you can access the dom to finf/set
field values.

-- bruce (sqlwork.com)


"Mark" <anonymous@discussions.microsoft.com> wrote in message
news:468533AE-F4B2-426B-8EF9-C659C460461B@microsoft.com...[color=blue]
> Hello All,
> I'm trying to have a .Net app open up a web form, enter values into a text[/color]
field (given the ID or Name), and submit. Ideally I could program something
like:[color=blue]
> 1 - Request Page given URL
> 2 - Set TextField1.Value = 'Hello'
> 3 - Submit Form (or Click a BtnSubmit)
>
> Any ideas how to start with this?
>
> Thanks,
> Mark
>[/color]


Mark
Guest
 
Posts: n/a
#5: Nov 18 '05

re: Use code to set values of webform and submit


Hello
I can already parse the HTML file, and I know exactly which field (Id and Name) to modify

With that, what do you mean by "you can access the dom to finf/setfield values"

Is there webpage that expands on that

Thanks
Mar

----- bruce barker wrote: ----

you need a hltm parser to parse the web form html

the easiest way to due this is host IE, and capture its events (page load
unload, etc). once a page has loaded, you can access the dom to finf/se
field values

-- bruce (sqlwork.com


"Mark" <anonymous@discussions.microsoft.com> wrote in messag
news:468533AE-F4B2-426B-8EF9-C659C460461B@microsoft.com..[color=blue]
> Hello All
> I'm trying to have a .Net app open up a web form, enter values into a tex[/color]
field (given the ID or Name), and submit. Ideally I could program somethin
like[color=blue]
> 1 - Request Page given UR
> 2 - Set TextField1.Value = 'Hello
> 3 - Submit Form (or Click a BtnSubmit[color=green]
>> Any ideas how to start with this
>> Thanks[/color]
> Mar
>[/color]
Closed Thread