Login on Internet Explorer website

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to automate a login and file download process. This occurs over the web.

I have the code that opens Internet Explorer and navigates to the website. The first page that comes up is a login page. My goal is to have c# add the user name and password to the appropriate text boxes. After that I would like c# to simulate button clicks (I can get the actual url if need be) to select and download the appropriate file.

Can someone point me in the right direction for coding this?

Thanks,
Jeff
 
Does this need to be done using C# or ASP/.NET I guess you should use some
flash type thing to do this .. I am getting the guide with this "I would
like c# to simulate button clicks :"

Nirosh.

Jeff said:
Hi,

I'm trying to automate a login and file download process. This occurs over the web.

I have the code that opens Internet Explorer and navigates to the website.
The first page that comes up is a login page. My goal is to have c# add the
user name and password to the appropriate text boxes. After that I would
like c# to simulate button clicks (I can get the actual url if need be) to
select and download the appropriate file.
 
Hi Jeff,

This can be done with the DOM, something like you'd do it from JavaScript
code within the Web page. Get the Window object (IHTMLWindow[2, 3, 4]) from
the IE instance, then query for the window's Document (IHTMLDocument[2, 3,
4, 5]]) , and then use the DOM as you would do that from JavaScript (the
code snippet below is rather a pseudo-code than a working C# code):

theDocument.all["userName"].text = "JohnDoe"
theDocument.all["password"].text = "password"
theDocument.forms[0].submit();

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

Jeff said:
Hi,

I'm trying to automate a login and file download process. This occurs over the web.

I have the code that opens Internet Explorer and navigates to the website.
The first page that comes up is a login page. My goal is to have c# add the
user name and password to the appropriate text boxes. After that I would
like c# to simulate button clicks (I can get the actual url if need be) to
select and download the appropriate file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top