Game Development Reference
In-Depth Information
ClickEdit —> 141, 1, 0, 0.09....................................Result: Success
Keys —> “[Backspace]�?, 0.82.....................................Result: Success
Keys —> “20�?, 0.37, 0.1.........................................Result: Success
ClickEdit —> 142, 1, 0, 1.74....................................Result: Success
Keys —> “[Backspace]�?, 0.62.....................................Result: Success
Keys —> “20�?, 0.51, 0.06........................................Result: Success
ClickEdit —> 143, 2, 0, 1.64....................................Result: Success
Keys —> “[Backspace][Backspace]�?, 0.64, 0.18....................Result: Success
Keys —> “2�?, 0.79...............................................Result: Success
CompareScreen —> “Region 2�?.....................................Result: Success
ClickButton —> “OK�?, 1, 22.25...................................Result: Success
CompareScreen —> “Window 2�?.....................................Result: Success
ActivateWindow —> “Minesweeper�?, “Minesweeper�?, 51249669, 10.0..Result: Failure
ClickMenu —> “&Game�?, 0.13......................................Result: Success
ClickMenu —> “&Game;&Custom...�?, 1.94...........................Result: Success
CompareScreen —> “Region 3�?.....................................Result: Success
************************************************************
* Log Ended on: Thu Dec 23 01:13:03 2004
************************************************************
Minesweeper Test Editing and Debugging
Hmm. All of the CompareScreen commands succeeded, but all of the ActivateWindow com-
mands failed! After applying Rule 1, look up the syntax for ActivateWindow in the VHT
User's Guide. You will find out that the third parameter is the window ID. Well, this
number is created anew each time the Minesweeper application is started. The IDs
recorded in your test are probably different than the ones listed in the preceding code.
To ignore the ID value during playback, use your editing skills to change the IDs to
NULL in all of the ActivateWindow commands. Here's what each one should look like:
ActivateWindow(“Minesweeper�?, “Minesweeper�?, NULL, 10.0)
Now rerun the test and you should get a Success result for every command.
If you need help debugging, consult the VHT User's Guide for the syntax and opera-
tional details of any commands that fail. Chapter 6 specifically describes the debugging
capabilities of VHT. If you're not sure why screen comparisons are failing, you can
select Screenshot… under the Compare menu in VHT. This gives you a list of the
images that were captured for your test. The ones with a red X, like Window 1 shown
in Figure 17.11, are the comparisons that failed. Click a failed item to see the image
captured during playback of the test. Clicking the displayed image will toggle between
the recently captured image and the test's reference image.
Search WWH ::




Custom Search