I tried this out on the Apprise page and it worked fine. > b = Watir::Browser.new :chrome => #<Watir::Browser:0x..fb82cba33eb6a57be url="about:blank" title="about:blank"> > b.goto "http://labs.bigroomstudios.com/libraries/Apprise-v2" => "http://labs.bigroomstudios.com/libraries/Apprise-v2" > content = b.button(text: "Apprise('hi there');").click => [] > b.button(id: "apprise-btn-confirm").click => [] > content = b.button(text: "Apprise('hi there');").click => [] > b.button(id: "apprise-btn-confirm").click => [] > content = b.button(text: "Apprise('Lorem ipsum...');").click => [] > b.button(id: "apprise-btn-confirm").click => []
worked fine in firefox as well > b = Watir::Browser.new :firefox => #<Watir::Browser:0x..fd31603afe9eface url="about:blank" title=""> > b.goto "http://labs.bigroomstudios.com/libraries/Apprise-v2" => "http://labs.bigroomstudios.com/libraries/Apprise-v2" > content = b.button(text: "Apprise('hi there');").click => [] > b.button(id: "apprise-btn-confirm").click => [] > content = b.button(text: "Apprise('Lorem ipsum...');").click => [] > b.button(id: "apprise-btn-confirm").click On Mon, Dec 2, 2013 at 11:22 AM, Liz Goodson <ewgood...@gmail.com> wrote: > The code that I am testing presents a confirmation dialog box, with two > options - "Yes" and "No". > > At first my code was bombing on the > > browser.alert.ok > > I was graciously advised by Jarmo to downgrade my ffi to 1.9.0. That > eliminated the problem, but now I have a new one: > > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:226:in > `rescue in wait_until_present': Window with locator {:index=>0, > /^(?-mix:Message\ from\ webpage|Windows\ Internet\ Explorer|Microsoft\ > Internet\ Explorer|(?-mix:Mensaje de p.*)|Explorer\ User\ Prompt)$/i} > doesn't ex > not visible! (RAutomation::UnknownWindowException) > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:224:in > `wait_until_present' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:206:in > `button' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-4.0.1/lib/watir-classic/dialogs/alert.rb:37:in > `ok' > from Eval.rb:112:in `block (2 levels) in <main>' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1792:in `each' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1208:in `block in foreach' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1354:in `open' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1207:in `foreach' > from Eval.rb:44:in `block in <main>' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1792:in `each' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1208:in `block in foreach' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1354:in `open' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1207:in `foreach' > from Eval.rb:32:in `<main>' > > > I have also tried > > browser.alert.set "Yes" > > > which produces a similar effect: > > > > C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:226:in > `rescue in wait_until_present': Window with locator {:index=>0, > /^(?-mix:Message\ from\ webpage|Windows\ Internet\ Explorer|Microsoft\ > Internet\ Explorer|(?-mix:Mensaje de p.*)|Explorer\ User\ Prompt)$/i} > doesn't exi > not visible! (RAutomation::UnknownWindowException) > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:224:in > `wait_until_present' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:214:in > `text_field' > from > C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-4.0.1/lib/watir-classic/dialogs/alert.rb:44:in > `set' > from Eval.rb:113:in `block (2 levels) in <main>' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1792:in `each' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1208:in `block in foreach' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1354:in `open' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1207:in `foreach' > from Eval.rb:44:in `block in <main>' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1792:in `each' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1208:in `block in foreach' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1354:in `open' > from C:/Ruby193/lib/ruby/1.9.1/csv.rb:1207:in `foreach' > from Eval.rb:32:in `<main>' > > In addition, I have tried > > browser.execute_script("window.confirm = function() {return true}") > > > It doesn't bomb. It exits without error, but the dialog is still present > and the code under test continues to wait for a button to be pressed. > > I have looked at the source code for the submit button and the ensuing > popup, and it is using "apprise" > > > <div class="grid_16 submitButtons"> > <input style="display: inline; float left;" > id="offer_form_submit"type="submit" value="Continue" onclick="return > showPopConfirm()" /> > </div> > ... > function showPopConfirm() > { > apprise('Did the Disclosure documents print correctly?', > {'verify':true, 'textYes':'Yes', 'textNo':'No'}, > function(e){ > if(!e){ > apprise(' Note: Click the "Click to Print Offer" button to reprint > disclosure details.', > {},function(){}); > return; > } > // form is being submitted here. Something is stopping it > from being validated. > $('#decideOfferForm').submit(); > > } > ); > } > > Anyone have any experience with javascript dialogs that use "apprise"? > What ruby/Watir code should I use to click the "Yes" button? > > Thanks for your invaluable help. > Liz > > > > > > > > > > -- > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > watir-general@googlegroups.com > http://groups.google.com/group/watir-general > watir-general+unsubscr...@googlegroups.com > > --- > 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 watir-general+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- 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 watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.