The AutoIt function name "WinGetText" should be a good keyword to google to see some useful example code. Here's a Watir list thread from earlier this year about it:
http://groups.google.com/group/watir-general/browse_thread/thread/5b6f529b16616bbc?pli=1 And a Watir wiki page that shows a little autoit code: http://wiki.openqa.org/display/WTR/File+Downloads As shown there, the usual pattern when working with AutoIt from Ruby is to create an AutoIt object, and use it to invoke the various AutoIt functions. Pretty painless. :) For example, to get the contents of the main window in a notepad.exe instance whose title is "Untitled - Notepad": autoit = WIN32OLE.new("AutoItX3.Control") text = autoit.WinGetText("Untitled - Notepad", "") I suggest playing around with the AutoIt functions in irb, that's the fastest way to get things working. The documentation for the avaliable functions is here: http://www.autoitscript.com/autoit3/docs/ As a side note, I think there may be an autoit object instantiated when you create an IE object with Watir, but I don't know if it's meant to be directly accessible. So the safest thing may be to create your own as shown in the snippets above. Bill On Thu, Feb 12, 2009 at 1:29 PM, Jason Shelton <[email protected]> wrote: > I have searched through the archives, but have not been able to find any > examples of what I am looking for. I have never used autoit, so are there > any ways to do this without it? I am willing to learn it if necessary. > Thanks in advance. > > - Shelton > >> Date: Thu, 12 Feb 2009 12:54:20 -0800 >> Subject: [wtr-general] Re: Verify text on a popup >> From: [email protected] >> To: [email protected] >> >> >> Hi, >> >> There should be some examples of how to do this in the list archives. >> There are several different ways to get the text of a dialog, but the >> easiest thing to do is probably to use autoit. Please reply back if >> you have questions about it. >> >> Bill >> >> >> On Thu, Feb 12, 2009 at 12:24 PM, Jason Shelton <[email protected]> >> wrote: >> > All, >> > >> > I have read the tutorial about killing a 'Windows Internet Explorer' >> > javascript popup, but I am writing to ask if there is a way to verify >> > the >> > text on these popups first, with a method similar to .contains_text? If >> > this question is not clear, I can elaborate. Thanks in advance. >> > >> > - Shelton >> > >> > ________________________________ >> > Windows Liveā¢: Keep your life in sync. See how it works. >> > > >> > >> >> > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to [email protected] Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---
