Re: [wtr-general] Re: Clicking "OK" javascript confirm popup?

2010-12-06 Thread Eric Mathiesen
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 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?

2010-12-06 Thread Charley Baker
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  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