Question

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

nb the username and password is the popup screen not an embedded username and password tag.

Was it helpful?

Solution

The popup user credential screen is what? Windows Credential dialog box? If you are talking about by passing the integrated authentication dialog box using WebBrowser control. Please 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.

OTHER TIPS

Though this can be done through a web request, there are pre-built tools which support this, like Selenium. It even comes with a FireFox plugin, which records your actions on a site (such as logging in) and exports the C# code needed to automate the command.

It used primarily as a test generation framework, but you could easily record the login, then edit the generated C# code to use a dynamic user name and password.

What makes this framework really nice is that it handles the html parsing for you. Additionally, it can optionally use a dedicated server or servers to perform the tests if you'll need to do a whole lot of queries.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top