b.javascript_dialog().exists? is not working for me in WATIR 4.0.2

32 views Asked by At

When I execute the code

b.javascript_dialog().exists?

it works fine in WATIR 3.0.0 but it's throwing the following error in WATIR 4.0.2, Why it is so? Have they given any other function corresponding to "javascript_dialog()"?

hello.rb:8:in <main>': undefined methodjavascript_dialog' for # (NoMethodError)

1

There are 1 answers

0
Justin Ko On BEST ANSWER

From the changelog for v3.1.0:

Remove Browser#(javascript_)dialog. Use Browser#alert API instead.

The javascript_dialog has been replaced by alert:

b.alert.exists?