[wtr-general] Re: Clicking OK javascript confirm popup?
I am using solution #6 from http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups. The Javascript popup disappears fine, but the underlying web application does not operate normally. I change 'Search Settings' in Google. I click on the Save Preferences button when I have finished updating the Google Search Settings and then click the OK button on the Javascript popup. If I do this manually the page goes back to the Google home page, but if I do it with Ruby-Watir the control stays on the Search Settings page. I have Watir 1.6.7 with ruby 1.8.7 (2010-08-16 patchlevel 302) [i386- mingw32] David On Dec 12, 11:23 am, Jarmo Pertman jarm...@gmail.com wrote: Use the simplest way to handleJavaScriptpopups described in the wiki athttp://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Jarmo Pertman - IT does really matter -http://www.itreallymatters.net On Dec 7, 2:31 am, Eric Mathiesen mathiese...@gmail.com wrote: Have you tried using .fire_event? Sry I'm on my cell On Dec 2, 2010 11:42 PM, slindsey3000 slindsey3...@gmail.com wrote: I have read quite a few things online over the last 2 days about clicking OK in ajavascriptconfirm pop-up. I have been unable to select ok using watir and IE. Here is the div -- div class=actions_wrapper clearfix p id=delete_threads class=btn small white small_white style= onmousedown=util.toggleClass(this, 'active') onmouseup=util.toggleClass(this, 'active') onmouseover=util.toggleClass(this, 'hover') onmouseout=util.toggleClass(this, 'hover')a href=#delete id= class= onclick=if(confirm('Deleting means no going back.')) {Mailbox.deleteThreads();} return false; target=Delete selected conversations/a/p p id=select_all_threads class=btn small white small_white style= onmousedown=util.toggleClass(this, 'active') onmouseup=util.toggleClass(this, 'active') onmouseover=util.toggleClass(this, 'hover') onmouseout=util.toggleClass(this, 'hover') a href=#selectall id= class= onclick=Mailbox.toggleThreadSelection(); return false; target=Select all/a/p /div My code -- browser.link(:text, Delete selected conversations).click_no_wait ??? -- End of code This (above) line triggers thejavascriptconfirm dialog. What goes in the ??? ... I have tried about 50 different things. My inexperience has gotten the best of me here with watir. Any help or direction appreciated. It seems like it should be easy and common to have to click onjavascriptOK buttons. Thanks! Shawn -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-gene...@googlegroups.comhttp://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- 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
[wtr-general] Re: Clicking OK javascript confirm popup?
Use the simplest way to handle JavaScript popups described in the wiki at http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Jarmo Pertman - IT does really matter - http://www.itreallymatters.net On Dec 7, 2:31 am, Eric Mathiesen mathiese...@gmail.com wrote: Have you tried using .fire_event? Sry I'm on my cell On Dec 2, 2010 11:42 PM, slindsey3000 slindsey3...@gmail.com wrote: I have read quite a few things online over the last 2 days about clicking OK in a javascript confirm pop-up. I have been unable to select ok using watir and IE. Here is the div -- div class=actions_wrapper clearfix p id=delete_threads class=btn small white small_white style= onmousedown=util.toggleClass(this, 'active') onmouseup=util.toggleClass(this, 'active') onmouseover=util.toggleClass(this, 'hover') onmouseout=util.toggleClass(this, 'hover')a href=#delete id= class= onclick=if(confirm('Deleting means no going back.')) {Mailbox.deleteThreads();} return false; target=Delete selected conversations/a/p p id=select_all_threads class=btn small white small_white style= onmousedown=util.toggleClass(this, 'active') onmouseup=util.toggleClass(this, 'active') onmouseover=util.toggleClass(this, 'hover') onmouseout=util.toggleClass(this, 'hover') a href=#selectall id= class= onclick=Mailbox.toggleThreadSelection(); return false; target=Select all/a/p /div My code -- browser.link(:text, Delete selected conversations).click_no_wait ??? -- End of code This (above) line triggers the javascript confirm dialog. What goes in the ??? ... I have tried about 50 different things. My inexperience has gotten the best of me here with watir. Any help or direction appreciated. It seems like it should be easy and common to have to click on javascript OK buttons. Thanks! Shawn -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-gene...@googlegroups.comhttp://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- 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
[wtr-general] Re: Clicking OK javascript confirm popup?
I can't believe this is so tough in Watir? Clicking on confirm seems impossible? Anyone? -- 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
Re: [wtr-general] Re: Clicking OK javascript confirm popup?
There are multiple ways to do it on the wiki and google the group for them. You've severed the original thread if you had one, so I have no idea as to what your script and html looks like. It is possible, but not easy and in all honesty, js dialogs are prevalent but also dated, it screams Welcome to the web in the early 90s. Have your devs take a look at it and see if there's something more palatable they can do. It's definitely possible and I've done it quite a lot, mostly in Windows with AutoIT or winclicker. Both need to be cleaned up. I'll tell you also that Webdriver and Selenium have the same difficulties and don't deal with it well. This is a rich area of development if you're so inclined to jump in. Impossible - no, easy, also no - across OSes. hth, Charley Baker Lead Developer, Watir, http://watir.com On Mon, Dec 6, 2010 at 1:08 PM, slindsey3000 slindsey3...@gmail.com wrote: I can't believe this is so tough in Watir? Clicking on confirm seems impossible? Anyone? -- 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 -- 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
Re: [wtr-general] Re: Clicking OK javascript confirm popup?
Hello, Try this... Substitutethe (Windows Internet Explorer, 'OK') with the title (if given) and the name of the control you want to click... I have the same issue with OK's, Close's and Yes's. This little script solved it for my application woes. require 'win32ole' begin autoit = WIN32OLE.new('AutoItX3.Control') loop do autoit.ControlClick(Windows Internet Explorer,'', 'OK') autoit.ControlClick(Windows Internet Explorer,'', 'Close') autoit.ControlClick(Security Information,'', 'Yes') autoit.ControlClick(Security Alert,'', 'Yes') autoit.ControlClick(Security Warning,'', 'Yes') autoit.ControlClick(Message from webpage,'', 'OK') # other options can be included here sleep 3 end rescue Exception = e puts e end On Mon, Dec 6, 2010 at 12:08 PM, slindsey3000 slindsey3...@gmail.comwrote: I can't believe this is so tough in Watir? Clicking on confirm seems impossible? Anyone? -- 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.comhttp://groups.google.com/group/watir-general%0awatir-general+unsubscr...@googlegroups.com -- 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