If you're just trying to dismiss an alert, it's pretty simple. Here's a
working example.
b = Watir::Browser.new :firefox
b.goto("http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert")
b.frame(:index => 1).button(:value => "Show alert box").click
# Get the text of the alert if you'd like
puts b.alert.text
# Dismiss the alert
b.alert.ok
On Thursday, February 7, 2013 10:32:24 PM UTC-5, [email protected] wrote:
>
>
> I've tried to implement code by following the online sample codes below,
> but it is not working, i'm not sure why?
>
> @browser = Watir::Browser.new
>
> @browser.goto(initial_url)
>
> @browser.link(:url, @browser.link(:url, "javascript:doNow()").click))
> popup = $browser.attach($browser.link(:url, $browser.link(:url,
> "javascript:doNothing()").click))
>
> Much appreciate for any suggestion/help
>
>
> On Thursday, 7 February 2013 14:03:28 UTC+8, [email protected] wrote:
>>
>>
>>
--
--
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.