Check this out, I've hacked watir's goto() method:

def goto(url)
            [EMAIL PROTECTED](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 auth popups for inline images and things.

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.
  Anyone have any ideas about how to make that happen through hacking
on Watir directly?

-Chris


On 5/3/06, Chris McMahon <[EMAIL PROTECTED]> wrote:
> So using net/http, I can do:
>
> my_id  = 'user'
> my_pwd = 'password'
> auth   = "Basic " + Base64.encode64( "#{my_id}:#{my_pwd}" )
>
> url    = '/'
> site   = 'server'
> port   = 80
>
> req = Net::HTTP.new( site, port )
> req.get( url, 'Authorization' => auth ) do |r|
>  puts r
> end
>
> Has anyone ever considered having Watir do
>
> my_id  = 'user'
> my_pwd = 'password'
> auth   = "Basic " + Base64.encode64( "#{my_id}:#{my_pwd}" )
>
> ie = IE.new
>     ie.goto("http://server";).auth
>
> It seems like it ought to be possible, and it'd save 99% of the
> WinClicker ugliness.
>
> -Chris
>

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to