Hi Jarmo, I can't speak for anyone else - but here are my thoughts on using AutoIt versus a pure Ruby approach (such as the code in the WinClicker class):
Since AutoIt provides a lot of ready-to-use Windows GUI automation functions, it's tempting to use it rather than re-implementing the same functionality in pure Ruby. On the other hand, as you have seen in winClicker.rb, Win32API and Ruby/DL make it possible to script some really useful scenarios in pure Ruby. So I think it's a tradeoff between reinventing the wheel a little (by writing one's own Windows GUI automation code in Ruby) or using an off-the-shelf library (such as AutoIt) where someone has already solved the problems. Also, some Windows GUI automation scenarios are a little challenging in pure Ruby. Here's an example: http://wiki.openqa.org/display/WTR/Right+Click+an+Element In that code the goal was to click a specific item in the popup menu that appears when you right-click an image in IE. But in the main() method in that example, you'll see that the code falls back to using AutoIt. Specifically, Watir's send_keys() method is used to select an item in the popup menu, since I could not figure out how to get a handle to the popup menu (or specific items in it) using Win32API or Ruby/DL. Automating scenarios like this could be easier if we had a Ruby interface to the MS UI Automation framework: http://en.wikipedia.org/wiki/Microsoft_UI_Automation But I haven't figured out how to pull that off using a pure Ruby approach. Maybe it's possible to write a helper .dll to allow use of the UI Automation framework from Ruby? Just a thought. Thanks Bill On Sun, Apr 18, 2010 at 2:48 PM, Jarmo <[email protected]> wrote: > Hello. > > I was wondering, what's the biggest difference between using AutoIt > and WinClicker class? As far as i've looked into the WinClicker class > and tried to handle file save as dialog and javascript popup windows > then everything seemed to work great. This made me wondering, why is > AutoIt even in use at all? Is there any limitations in WinClicker > class? Does this class have some bugs or doesn't it work reliably > enough? > > As far as i see then it just needs some additional methods and it > would be great. Maybe Watir could even drop dependency to AutoIt? It > would just need some refactoring. > > Also please share any experience using WinClicker class. > > Any ideas, concerns, thoughts about this topic are welcome. > > Jarmo > _______________________________________________ > Wtr-development mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/wtr-development >
_______________________________________________ Wtr-development mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-development
