| || |
Detecting which window I\'m in
User Howard Shidlowsky (email@example.com) posted:
I'm just starting with WinRunner and trying to test a Java application
that's started from IE. I have no problem with most things but can't
quite figure out how to get WinRunner to confirm that I'm in the right
application window. I tried adding a checkpoint on an object/window
(win_check_gui) but when I reran the script it always complains that
there's a mismatch, even if I use the GUI tool to learn about the
window again. I also tried a checkpoint on the title bar of a specific
window using something like
if (win_find_text ("Window title", "label", "ABC") == E_OK)
where ABC is the first word in the window title but this just returns
a code telling me the text wasn't found. Does this function call
actually check the text in the title bar? If not, how can I do that?
Would a regular expression, for example "!ABC*" work?
Thanks for help.
Re: Detecting which window I\'m in
Something like this ought to work. Use the 'GUI Spy' tool to verify what window attribute you want to check in the win_check_info() function.
<pre>if(win_check_info("My Window", "active", 1) == E_OK)
# do something
report_msg("Window 'My Window' is not active");
# do something
Software Testing (n): 1. The art of trying to increase your confidence in a piece of software by finding everything that is wrong with it.
[This message has been edited by creace (edited 06-29-2001).]