Question

Is there a tutorial for using AutoIT to handle modal windows in Watir or Firewatir?

Was it helpful?

Solution

Firstly let me again plug the hardware click duck punch for WATiR, which can be found here. This will allow you to do hardware left clicks on discoverable elements, and you can tweak it to do whatever you need. It will literally take your mouse pointer and do a top-level click at the coordinates.

Secondly there is a method in WATiR to handle modal dialogs:

ie.modal_dialog.text_field(:name, 'my_textfield').set('badger) 

Although I think this is version specific, you may have to dig out an older version.

Thirdly, yes. Ish. Here are some resources that will be helpful:

List of AutoIT win message codes AutoIT with Ruby Steve Swanson being all helpful

There is also a method in Watir to send keystrokes: browser.SendKeys("boo{TAB}{ENTER}")

But an actual "This is how to use AutoIT in WATiR to interact with modal windows"? Not that I've ever seen or can find. If you wish to take this approach you may want to search for "Ruby AutoIT" rather than "WATiR AutoIT".

OTHER TIPS

Every AutoIt installation comes by default with a tutorial on automating Notepad (notepad.exe), which also deals with the modal window that appears when you are asked to save a file. The tutorial explains the absolute basics, which depending on your own know-how, might not be what you need. If you need a more specific answer, then clarify what you're trying to do. As a final note, I want to add that there are no tutorials on how to deal with Watir or Firewatir specifically.

  1. Use Ruby ability to access AutoIt methods. Search for these lines:

    require 'win32ole'; au3 = WIN32OLE.new("AutoItX3.Control")

  2. Watir can handle different pop-ups on its own with little efforts. Look here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top