This is working now...Implemented as below : message = @page.confirm(true) do @page.button_that_causes_the_confirm end message.should == "Text from the confirm popup"
On Tuesday, March 19, 2013 11:24:18 AM UTC, [email protected] wrote: > > Hi, > In my application I've to click on deactivate button which returns a popup > (*Are you sure you want to deactivate this A/B Test? After deactivation, > this test can\'t be activated again.)* with OK and Cancel buttons.I've to > click on 'OK'. > I tried many ways but no luck..Your help is much appreciated. > > Here is the code: > > <div id="content"> > <h3>A/B Testing</h3> > <form id="abform" method="POST"> > <input type="hidden" value="3822" name="config.id"> > <label class="formLeft" for="start"> > <input id="start" class="calendar" type="text" size="10" > value="18/03/2013" name="config.start" disabled=""> > <div class="spacersmall"></div> > <label class="formLeft" for="end"> > <input id="end" class="calendar" type="text" size="10" value="" > name="config.stop" disabled=""> > <div class="spacersmall"></div> > <label id="mode" class="formLeft" for="mode">Mode</label> > <select name="config.mode"> > <div class="spacersmall"></div> > <label class="formLeft">Channel</label> > <select name="config.channel"> > <div class="spacersmall"></div> > <label class="formLeft"> > <label class="formLeft"> > <label class="formLeft"> > <label class="formLeft"> > <label class="formLeft"> > <div class="spacer"></div> > <div class="box widgets_A"> > <div class="spacer"></div> > <div class="box widgets_B"> > <div class="spacer"></div> > <div class="box widgets_C" style="display: none;"> > <div class="spacer" style="display: none;"></div> > <div class="box widgets_D" style="display: none;"> > <div class="spacer" style="display: none;"></div> > <div class="box widgets_E" style="display: none;"> > <div class="spacer" style="display: none;"></div> > <div class="spacer"></div> > <label class="formLeft">Comments</label> > <textarea name="comment.comment"></textarea> > <div class="spacer"></div> > <div class="spacer"></div> > <input class="submit120" type="submit" onclick="return confirm('Are you > sure you want to update this A/B Test?');" value="Update" name="_update"> > *<input class="submit120" type="submit" onclick="return confirm('Are you > sure you want to deactivate this A/B Test? After deactivation, this test > can\'t be activated again.');" value="Deactivate" name="_deactivate">* > <input class="submit120" type="submit" onclick="return confirm('Are you > sure you want to delete this A/B Test? After deletion, all track info for > this a/b test is lost.');" value="Delete" name="_delete"> > </form> > </div> > </div> > > I've tried as below : > 1-- browser.execute_script("window.confirm = function() {return true}") > 2-- browser.alert.ok > 3 --browser.button_submit(:class => "submit120").click > > Error message : > no block given (yield) (LocalJumpError) > > > -- -- 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.
