Tried the above, didn't worked... I found a workaround for this - setting 
the timeout to minimum will do the thing: 

*client = Selenium::WebDriver::Remote::Http::Default.new *
*client.timeout = 2*
*b = Watir::Browser.new :firefox, :http_client => client*

after this autoit will handle any requests easily.

url = 'http://your-secure-url:8080/blabla'
b.goto url #time outs after 2 seconds and then

*autoit = WIN32OLE.new("AutoItX3.Control")
*
*autoit.WinWait("Authentication Required", "")*
*autoit.WinActivate("Authentication Required", "")*
*autoit.Send(@user)*
*autoit.Send("{TAB}")*
*autoit.Send(@pass)*
*autoit.Send("{ENTER}")*

Voila :)

On Tuesday, August 12, 2008 12:55:34 PM UTC+3, aidy lewis wrote:
>
> Hi,
>
> On this page: http://wiki.openqa.org/display/WTR/Basic+Authentication,
> there is a main.rb with this code.
>
> <code>
> require 'unittests/setup'
> require 'watir'
> require 'watir/WindowHelper'
>
> class TC_Logon_Test < Test::Unit::TestCase
>   def setup
>     @url = 'yoursite.com'
>     @login_title = "Connect to #{@url}"
>     @username = 'uname'
>     @password = 'pass'
>   end
>
>   def test_logon
>     a = Thread.new {
>       system("ruby handle_logon.rb \"#{@login_title}\"
> \"#{@username}\" \"#{@password}\"")
>     }
>
>     b = Thread.new {
>       system('ruby handle_security_alert.rb')
>     }
>
>     $ie.goto(@url)
>
>     a.join
>     b.join
>
>     # continue code here...
>
>   end
>
> end
>
> </code>
>
> It uses the system kernel method to run two Ruby files:
> handle_logon.rb && handle_security_alert.rb.
>
> I am not sure where these files exist or what they contain?
>
> Aidy
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to