Oscar,

In my experience, the easiest thing to do is to hack up your "goto"
method to allow for an option that doesn't wait for the page to load
before passing back control to your script.  Then, assuming you can
get your username and password saved in your browser, you can just use
AutoIT to send an "Enter" keystroke to clear the dialog with a
successful login.

There's a patch (the larger) attached to this issue that contains such
a code change and allows you to use the syntax below for the "goto"
method: http://jira.openqa.org/browse/WTR-146

NOTE: This will not work without aforementioned patch!

  @application_base = "http://yoursite.com";
  $ie.goto(@application_base, :wait => false)
  sleep 7
  @autoit = WIN32OLE.new('AutoItX3.Control')
  @autoit.Send "{ENTER}"
  @autoit = nil
  sleep 5

Once you get that working, you could experiment with using AutoIT or
the WinClicker that comes with Watir (I've never really been able to
get this to work, but YMMV) to populate usernames and passwords in the
dialog.  Maybe someone else can give an example . . .

Ethan

On 3/21/07, Oscar <[EMAIL PROTECTED]> wrote:
> Hello, thanks in advance for any help you can give me.
>
> I'm trying to begin writing a test for an internal app. The website uses 
> simple Apache Browser authentication so it pops up with a Windows-looking 
> authentication window.
>
> I've searched high and low for help on this but I can't find how to interact 
> with this so I thought I'd ask here.
>
> I've searched for: "windows security" "browser authentication" "login" 
> "logon" "login pop up" "default browser pop up" and a bunch of other terms. I 
> can't find anything related... google, or here.
>
> How do I go about entering a username and password on this? I tried using irb 
> to and all_objects to see if i could find anything but the moment I go to the 
> site, irb will be just waiting for the page to finish loading so I can't even 
> query it to see what is available to me.
>
> Any ideas?  Here's a screenshot of the window I get just so you see exactly 
> what I'm talking about.
> http://www.flickr.com/photos/[EMAIL PROTECTED]/429653070/
> _______________________________________________
> Wtr-general mailing list
> Wtr-general@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wtr-general
>
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to