When confused, check the unit test.
From dialog_test.rb:
def test_confirm_ok
$ie.remote_eval <<-END
button(:value, 'confirm').click
END
assert dialog.exists?
dialog.button('OK').click
assert_equal "You pressed the Confirm and OK button!",
$ie.text_field(:id, 'testResult').value
end
At 02:06 PM 8/24/2005, Lisa Crispin wrote:
I did look at dialog.rb, but my ruby/watir/general programming
language knowledge is not sufficient to understand how to write the
script to click a javascript alert button. Can anyone provide a more
detailed explanation? Is there any doc on 'autoit' that might help
me?
thanks
Lisa
Message: 3
Date: Tue, 23 Aug 2005 00:49:24 -0500
From: Bret Pettichord <[EMAIL PROTECTED]>
Subject: Re: [Wtr-general] How to click a javascript alert button
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"; format=flowed
This is the hardest thing to do with Watir right now, and out top priority
to fix.
You might want to look at watir/dialog.rb in HEAD for a new way to handle
this -- see dialog_tests.rb for examples on how to use this.
What is HEAD -- this is our CVS repository.
At 02:44 PM 8/22/2005, Lisa Crispin wrote:
>Our app has some buttons that, when clicked, pop up a Javascript alert
>and want a 'yes' or 'ok' response to continue and do the function that
>they do. I found some suggestions for how to do this with Watir but
>none of 'em worked. For example I tried this one:
> Thread.new { sleep 0.1; WindowHelper.new.push_alert_button }
> $ie.link(:id, "whatever").click #this causes an Alert()
>Unfortunately I've forgotten the other one I tried and can't find it
>now (this was Friday, I've had a whole weekend to forget).
>
>I found some emails with references to AutoIt, and tried researching
>that but the emails were too cryptic for me. Is there a way to click
>a button on a Javascript popup alert?
>thanks
>Lisa
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general
_____________________
Bret Pettichord
www.pettichord.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general