Launch browser from C # and enter username and password

I was wondering if anyone knows how to start a normal browser session and enter username and password details from C # code - perhaps using a webrequest?

nb username and password is a popup screen, not a built-in username and password.

+2


source to share


2 answers


Popup credentials screen - what is it? Windows credentials window? If you say passing the Integrated Authentication dialog box with the WebBrowser control. See this link, http://izlooite.blogspot.com/2009/06/bypass-integrated-authentication-using.html .



Let me know if this solves your problem, I can provide you with the code.

+1


source


While this can be done using a web request, there are out-of-the-box tools that support this, like Selenium . It even comes with a FireFox plugin that records your actions on the site (like login) and exports the C # code you need to automate the command.

It is mainly used as a test generation framework, but you can easily write the login and then edit the generated C # code to use a dynamic username and password.



What makes this structure really nice is that it handles the html parsing for you. In addition, it can optionally use a dedicated server or servers to run tests if you need to make a lot of requests.

+1


source







All Articles