help with Internet Explorer +Watir +basic authentication?

C

Chris McMahon

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.
 
P

paul.rogers

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
 
A

alex_f_il

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.
 
C

Chris McMahon

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.
 
B

Bret Pettichord

Alex,

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

Bret
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,225
Members
46,815
Latest member
treekmostly22

Latest Threads

Top