1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Watin Login Dialog

Discussion in 'C, C++, C#' started by qrazy, Dec 18, 2012.

Tags:
  1. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    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.
     
  2. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    bumping.....................
     
  3. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    Bump... Anyone??????????
     
  4. Gramking

    Gramking Registered Member

    Joined:
    Dec 18, 2012
    Messages:
    99
    Likes Received:
    39
    Location:
    Where the money at
    Instead of actually filling out any dialog, I suggest authenticating through the HTTP headers.
     
    • Thanks Thanks x 1
  5. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    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?

     
  6. Gramking

    Gramking Registered Member

    Joined:
    Dec 18, 2012
    Messages:
    99
    Likes Received:
    39
    Location:
    Where the money at
    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.
     
  7. Gramking

    Gramking Registered Member

    Joined:
    Dec 18, 2012
    Messages:
    99
    Likes Received:
    39
    Location:
    Where the money at
    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.
     
  8. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    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 :)

     
  9. RottenYellow

    RottenYellow BANNED BANNED

    Joined:
    Sep 10, 2010
    Messages:
    68
    Likes Received:
    16
    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.
     
    • Thanks Thanks x 1
  10. qrazy

    qrazy Senior Member

    Joined:
    Mar 19, 2012
    Messages:
    1,113
    Likes Received:
    1,712
    Location:
    Banana Republic
    That would be of great help.

     
  11. RottenYellow

    RottenYellow BANNED BANNED

    Joined:
    Sep 10, 2010
    Messages:
    68
    Likes Received:
    16
    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
     
  12. handmadebots

    handmadebots Senior Member

    Joined:
    Nov 8, 2012
    Messages:
    905
    Likes Received:
    204
    Home Page:
    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.
     
  13. Blackberry_11

    Blackberry_11 Regular Member

    Joined:
    Apr 17, 2011
    Messages:
    266
    Likes Received:
    19
    Please write more about it ,
    because a dialogue need a descriptive area to analysis.