Hi Jarmo,
First I'll say - Great work on this gem!!
I have been playing with this and it works very well. I did run into
one thing that I'm not sure on though. If I click in a dialogue that
launches a popup - "window3.button(:value => "&Run").click", the
script hangs and then times out. I don't see a "click_no_wait" method
in the Rautomation::Button class. Is this something that will be
considered. Perhaps a thread can be used to handle the popup - I'll
try that next.
Below is the irb session. After the timeout, I attach to the popup and
finish the intended process .
C:\>irb
irb(main):001:0> require "rautomation"
=> true
irb(main):002:0> window1 = RAutomation::Window.new :title => /File
Download/
=> #<RAutomation::Window:0x28e8ea4 @adapter=:ffi,
@window=#<RAutomation::Adapter
::Ffi::Window:0x2d7f5a8 @locators={:title=>/File Download/}>>
irb(main):003:0> window1.title
=> "File Download - Security Warning"
irb(main):004:0> window1.button(:value => "&Save").click
=> true
irb(main):005:0> window2 = RAutomation::Window.new :title => /Save/
=> #<RAutomation::Window:0x2d6ab30 @adapter=:ffi,
@window=#<RAutomation::Adapter
::Ffi::Window:0x2d6aa90 @locators={:title=>/Save/}>>
irb(main):006:0> window2.title
=> "Save As"
irb(main):007:0> window2.button(:value => "&Save").click
=> true
irb(main):008:0> window3 = RAutomation::Window.new :title => /
Download/
=> #<RAutomation::Window:0x2d299c8 @adapter=:ffi,
@window=#<RAutomation::Adapter
::Ffi::Window:0x2d2984c @locators={:title=>/Download/}>>
irb(main):009:0> window3.title
=> "Download complete"
irb(main):010:0> window3.button(:value => "&Run").click
RAutomation::WaitHelper::TimeoutError: timed out after 60 seconds
from c:/ruby/lib/ruby/gems/1.8/gems/rautomation-0.3.0/lib/
rautomation/wa
it_helper.rb:20:in `wait_until'
from c:/ruby/lib/ruby/gems/1.8/gems/rautomation-0.3.0/lib/
rautomation/ad
apter/ffi/button.rb:25:in `click'
from c:/ruby/lib/ruby/gems/1.8/gems/rautomation-0.3.0/lib/
rautomation/bu
tton.rb:15:in `click'
from (irb):10
irb(main):011:0> window4 = RAutomation::Window.new :title => /Internet
Explorer/
=> #<RAutomation::Window:0x2d6e0b4 @adapter=:ffi,
@window=#<RAutomation::Adapter
::Ffi::Window:0x2d6dd1c @locators={:title=>/Internet Explorer/}>>
irb(main):012:0> window4.title
=> "Internet Explorer - Security Warning"
irb(main):013:0> window4.button(:value => "&Run").click
=> true
irb(main):014:0>
Regards
Darryl
On Dec 19, 7:25 am, Jarmo Pertman <[email protected]> wrote:
> That would be great. Please don't forget to give any feedback after
> you've tried it.
>
> Jarmo Pertman
> -----
> IT does really matter -http://www.itreallymatters.net
>
> On Dec 18, 11:27 pm, Arto Vuori <[email protected]> wrote:
>
> > Appears promising! I'm about to extend my watir test suite to interact
> > with non-ie windows. I'll give your lib a try.
>
> > --Arto
>
> > On 18 joulu, 01:14, Jarmo <[email protected]> wrote:
>
> > > I'm pretty sure that some of you already have noticed the library i've
> > > made
> > > to automate windows and their controls. I've now written a short blog post
> > > about it.
>
> > >http://www.itreallymatters.net/post/2352350743/automating-windows-and...
>
> > > If that thing seems to work well then what do you think if we'd replace
> > > AutoIt and win32-api in Watir with this eventually? I'd be happy to do
> > > that.
>
> > > Jarmo
--
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]