Watin Login Dialog

qrazy

Senior Member
Joined
Mar 19, 2012
Messages
1,113
Reaction score
1,738
Hey guys,
I am using C# with watin to run some tests in vista and XP without any issues. I wanted to upgrade to windows server 2008 and ran into problems authenticating the proxy server because the authentication dialog seem to have changed in windows 7 & 2008 platforms. I haven't looked into this much and thought many people would've encountered similar issues and resolved them.

Any help would be highly appreciated.
 
bumping.....................
 
Bump... Anyone??????????
 
Instead of actually filling out any dialog, I suggest authenticating through the HTTP headers.
 
Thanks for the reply. I know to use the proxy credentials if it's thru WebRequest. Here I am just using the IE object of the Watin to do everything. I am not quite sure how do I control the headers sent when using Watin. Any tip to accomplish this?

Instead of actually filling out any dialog, I suggest authenticating through the HTTP headers.
 
Thanks for the reply. I know to use the proxy credentials if it's thru WebRequest. Here I am just using the IE object of the Watin to do everything. I am not quite sure how do I control the headers sent when using Watin. Any tip to accomplish this?
I'll be honest, I've never used Watin -- but if it is the same as a normal browser control, one of the overloads should be header options.

http://msdn.microsoft.com/en-us/library/ms161356.aspx

additionalHeaders
Type: System.String
HTTP headers to add to the default headers.
 
It would work like this:

browser.Navigate("http://google.com/", null, null, "User-Agent: Testbot 1.0");

Anyhow, if you can write this in HttpWebRequest, go for it. There is absolutely no reason to use Watin whatsoever.
 
Thanks buddy. I've used navigate to do this. But I am not sure if watin supports such. And the problem is I don't have a development environment on windows 2008 :-(. As the program already works with watin I wouldn't be changing that to Webrequest. I am looking into the code of watin to see if it supports any header modification.

I am sure some would've encountered this and hope to get some solution soon :-)

It would work like this:

browser.Navigate("http://google.com/", null, null, "User-Agent: Testbot 1.0");

Anyhow, if you can write this in HttpWebRequest, go for it. There is absolutely no reason to use Watin whatsoever.
 
Not sure if I understood your issue correctly, but one thing you could do is use watin with firefox and edit firefox configuration file to setup proxy. I can give you a source I wrote to do that.
 
That would be of great help.

Not sure if I understood your issue correctly, but one thing you could do is use watin with firefox and edit firefox configuration file to setup proxy. I can give you a source I wrote to do that.
 
Here you go: http://pastebin.com/baBhEUfj
I wrote it long time ago, so it's messy and has bunch of extra code you don't need (like the Log method)

Here's the class:


public partial class FireFoxNetworkSettings
{
public string http;
public int http_port;
public string socks = "";
public int socks_port = 0;
public int proxy_type = 5;
}

Good luck and let me know if you have any questions
 
I am also using watin in some cases... to use proxy in every windows (if you're using the IE browser) search on google for "change ie proxy from regedit c#" and you will find your answer.
 
Please write more about it ,
because a dialogue need a descriptive area to analysis.
 
Back
Top