Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > help with Internet Explorer +Watir +basic authentication?

Reply
Thread Tools

help with Internet Explorer +Watir +basic authentication?

 
 
Chris McMahon
Guest
Posts: n/a
 
      05-03-2006
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.

 
Reply With Quote
 
 
 
 
paul.rogers@shaw.ca
Guest
Posts: n/a
 
      05-03-2006
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.


 
Reply With Quote
 
 
 
 
Chris McMahon
Guest
Posts: n/a
 
      05-03-2006
Turns out it's the frames that are not being retrieved with the auth
headers. I have exactly the problem described here, I think:

http://www.talkaboutsoftware.com/gro...ges/17461.html

 
Reply With Quote
 
alex_f_il@hotmail.com
Guest
Posts: n/a
 
      05-04-2006
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.

 
Reply With Quote
 
Chris McMahon
Guest
Posts: n/a
 
      05-05-2006
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.

 
Reply With Quote
 
Bret Pettichord
Guest
Posts: n/a
 
      05-07-2006
Alex,

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

Bret

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer 8: C:\Program Files\Internet Explorer\iexplore.exe vs C:\Program Files (x86)\Internet Explorer\iexplore.exe Nathan Sokalski Windows 64bit 16 02-22-2010 08:31 AM
internet explorer 7 - Internet Explorer cannot display the webpag sandy j Windows 64bit 0 05-02-2009 02:12 AM
Need help to restore "explorer.exe" functionality. Note this is NOT an Internet Explorer issue. oldsoul Computer Support 10 07-12-2005 03:09 PM
Windows Explorer - Internet explorer JamesBenson Computer Support 19 07-31-2004 12:54 AM
can surf in Windows Explorer not Internet Explorer Billh Computer Support 0 05-02-2004 08:47 PM



Advertisments