Loading ...
Sorry, an error occurred while loading the content.

Expand Messages
  • Dennis K. Paulsen
    Based on your question, it seems you could use WaitWindow. If your message box or dialog box includes the result (Success/Fail) in its caption you can do
    Message 1 of 2 , Jul 6 1:46 PM
    • 0 Attachment
      Based on your question, it seems you could use WaitWindow.

      If your message box or dialog box includes the result (Success/Fail)
      in its caption you can do something like this to process the result:

      # Example based on a caption convention of: "AppName - ProcessName
      ProcessResult"; where ProcessResult is Success/Fail
      # Note: 3600 = wait at most 1hr for resulting message box to pop up
      my $win = WaitWindow('AppName - ProcessName', 3600);
      if (!$win) {
      die("Validation process did not produce a message box!");
      }

      # Look for result string in message box caption and act on it
      if (GetWindowText($win) =~ /Success/i) {
      # <Handle Success Result>
      } else {
      # <Handle Failure Result>
      }


      *However, if the message box does not include the result in its
      caption, but instead in a label within the message box, you could make
      some modifications to read the label from the message box using
      WMGetText. The README and examples that come with Win32::GUITest
      should help to clarify the usage of these functions.


      I hope that helped,
      Dennis K. Paulsen


      --- In perlguitest@yahoogroups.com, "Stuart Arnold"
      <stuart.arnold@c...> wrote:
      >
      > Hi all,
      > I've seen postings and stuff on the net regarding WaitWindow(). It says
      > its in win32::guitest, but I see references to an X11:guitest when i
      > search.
      >
      > What I really just need is to just do this:
      > -start the app with a FileOpen on a file. (i can do that) -press a
      > button to validate the file (I can do that) -wait for a SUCCESS/FAIL
      > message box (no how do I do that?)
      >
      > Once I have the Message or Dialog box, I can inspect the WindowHandle
      > that some "WaitWindow" (or whatever), and see which way to process the
      > window.
      >
      > Should I use GetMessage/Dispatch Message, WaitForSingleObject, ...?
      >
      > Any help is greatly appreciated!
      >
      > Thanks,
      > -Stuart
    Your message has been successfully submitted and would be delivered to recipients shortly.