help with Internet Explorer +Watir +basic authentication?

Discussion in 'Ruby' started by Chris McMahon, May 3, 2006.

  1. Hi...

    After googling for lots of Win32OLE goodies, I've hacked the Watir
    goto() method to pass Basic Authentication credentials:

    def goto(url)
    #@ie.navigate(url)
    @ie.navigate(url,nil,nil,nil,"Authorization: Basic
    AbdXyz46bG1ubw==\n")
    wait()
    sleep 0.2
    return @down_load_time
    end

    and it works!!

    The only problem is that it works only for the very first transaction.
    I'm now getting authorization popups for inline images and things on
    the very first page.

    Under normal circumstances, the browser, having passed basic
    authentication credentials once to this site would know to *always*
    pass
    those credentials to that site for every subsequent GET/POST/whatever.

    But that doesn't seem to be the case when I navigate() to the site from
    within Watir's goto() method.

    Any suggestions for persuading IE-controlled-by-Watir to always pass
    auth credentials for every GET/POST would be welcome.
     
    Chris McMahon, May 3, 2006
    #1
    1. Advertising

  2. Chris McMahon

    Guest

    Chris, I cant get my web email to work, so couldnt reply to your
    message on the watir list

    Watir has a thing called an error checker, look at the watir source for
    the HTTP_Checker ( I think thats what ts called).

    The checker gets run on every page load, normally you would use it to
    see if something you expect on every page ( like a logo ) is there.

    You may be able to write one that appends the auth string to the end of
    gets and puts

    Paul


    Chris McMahon wrote:
    > Hi...
    >
    > After googling for lots of Win32OLE goodies, I've hacked the Watir
    > goto() method to pass Basic Authentication credentials:
    >
    > def goto(url)
    > #@ie.navigate(url)
    > @ie.navigate(url,nil,nil,nil,"Authorization: Basic
    > AbdXyz46bG1ubw==\n")
    > wait()
    > sleep 0.2
    > return @down_load_time
    > end
    >
    > and it works!!
    >
    > The only problem is that it works only for the very first transaction.
    > I'm now getting authorization popups for inline images and things on
    > the very first page.
    >
    > Under normal circumstances, the browser, having passed basic
    > authentication credentials once to this site would know to *always*
    > pass
    > those credentials to that site for every subsequent GET/POST/whatever.
    >
    > But that doesn't seem to be the case when I navigate() to the site from
    > within Watir's goto() method.
    >
    > Any suggestions for persuading IE-controlled-by-Watir to always pass
    > auth credentials for every GET/POST would be welcome.
     
    , May 3, 2006
    #2
    1. Advertising

  3. Chris McMahon, May 3, 2006
    #3
  4. Chris McMahon

    Guest

    Have you seen SW Explorer Automation (http:\\webunittesting.com). The
    program is easier to use then WATIR. The program handles all IE
    windows: popup, windows dialogs (including authentication dialog) and
    html dialogs.
     
    , May 4, 2006
    #4
  5. I would really rather find a way for IE to actually recognize Basic
    Authentication headers and react appropriately when invoked from a
    script. I've tried a couple of ways, but haven't found how to make it
    work when scripting IE.
     
    Chris McMahon, May 5, 2006
    #5
  6. Alex,

    I see you've plugged your program a couple times on this list. Does it
    support Ruby?

    Bret
     
    Bret Pettichord, May 7, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cmay
    Replies:
    0
    Views:
    1,171
  2. Ed Hauptman
    Replies:
    7
    Views:
    1,089
    Ed Hauptman
    Aug 7, 2009
  3. Peter Larsen [CPH]

    Internet Explorer and Kernel mode authentication on IIS7

    Peter Larsen [CPH], Jul 30, 2010, in forum: ASP .Net Security
    Replies:
    2
    Views:
    1,838
    Peter Larsen [CPH]
    Aug 11, 2010
  4. Anukul Singhal
    Replies:
    1
    Views:
    183
    Charley Baker
    May 15, 2008
  5. John Smith
    Replies:
    1
    Views:
    166
    Evertjan.
    Mar 12, 2005
Loading...

Share This Page