Game Development Reference
In-Depth Information
In this case, explain that what is happening is only for the purposes of cleaning up and
is not intended to test any particular functionality. Here's an example you can put at
the beginning of your cleanup file:
LogComment(“Nothing more to check, just shutting down for next test...�?)
That part was easy, but what about implementing the four cleanup steps? One strategy
would be to capture the cleanup steps and then add the LogComment statement. You
already know how to do that, so think about another possibility. Okay, time's up! You
could enter the test code directly into the file. Take a look at what you have already
captured and see if any of those operations are similar to the cleanup activities.
First, there's an example of clicking the OK button in the main test routine. The com-
mand is
ClickButton(“OK�?, 1, 12.25)
Next, there are also commands to activate the Minesweepe r window. These are the
ones you edited to use NULL instead of a specific window ID:
ActivateWindow(“Minesweeper�?, “Minesweeper�?, NULL, 10.0)
There is no exact match for cleanup step 4 in the main test file, but there is something
that is close. In the main test file there are commands that choose the Custom option
from the Game menu. This requires two steps: selecting the Game menu and then
selecting Custom… from the option list. Since you want the Beginner option, change
“Custom�? to “Beginner�? like so:
ClickMenu(“&Game�?, 0.11)
ClickMenu(“&Game;&Beginner�?, 1.13)
Last but not least, you need to provide some way to close the Minesweeper window.
Since you've seen the ActivateWindow command, it may not be too much of a leap to
guess that there is a CloseWindow command. A quick check of the VHT User's Guide
reveals that indeed there is. Just add the window name and you're all set to go. Here's
what the complete cleanup should look like, after filling in your header information:
;FileName: c:\documents and settings\administrator\desktop\vht test files\minesweepercp\
;Created: Thu Dec 23 10:58:57 2004
;Author: Me
;Product: Game Testing All in One
;Abstract: Reusable script to shutdown Minesweeper after each test
Search WWH ::

Custom Search