It is just what I need.
But...

This is my script:

require 'watir/dialog'
ie = Watir::IE.attach(:title, //)
ie.remote_eval "ie.link(:text, 'Delete this list').click"
dialog.button('OK').click

Error appears after running it: undefined local variable or method `dialog'
for main:Object (NameError)

When I add:

include Watir

to my script (as in dialog_tests.rb) it works fine.
Am I doing something wrong, or should I just add 'include Watir' to my
scripts?

Zeljko

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord
Sent: Tuesday, August 09, 2005 4:43 AM
To: [email protected]
Subject: [Wtr-general] New, improved support for popup dialogs

I've committed the initial version of new code for supporting popup dialogs.

Using this code:
- You don't have to use separate 'mini-scripts.'
- You don't have to spawn a process.
- You don't have to spawn a thread.

This is all done for you behind the scenes.

You use it like this:

         require 'watir/dialog'
         $ie.remote_eval <<-END
                 button(:value, 'whatever').click
         END
         dialog.button('OK').click

Note that remote_eval takes a string argument. This is the same:

         ie.remote_eval "button(:value, 'whatever').click"

The code in the string is evaluated in the context of an equivalent IE 
object in an independent process.

See dialog_tests.rb for more examples.

I am very interested in getting feedback on the names of the interface for 
this functionality: "remote_eval", "dialog", etc

Get the development tarball:
http://rubyforge.org/cgi-bin/viewcvs.cgi/watir/watir.tar.gz?tarball=1&cvsroo
t=wtr

This code currently supports simple dialogs. Next is to add support for the 
authorization dialogs -- a frequently requested thing. I really would like 
to have unit tests for this, which means i need a quick server that does 
authorization. Anyone know how to roll one with webrick?


_____________________
  Bret Pettichord
  www.pettichord.com

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to