background image
<< Testcase - Recording an application state | Testcase - Using data-driven testcases >>
Testcase - Testing the application state
<< Testcase - Recording an application state | Testcase - Using data-driven testcases >>
188
User's Guide
8 G
ENERALIZING
A
T
ESTCASE
Using application states
7
Drive your application to the state you want to record. At any point, you
can record a verification by pressing Ctrl+Alt.
8
When you have finished recording an application state, press Done on
the Record Status window. SilkTest redisplays the Record Application
State dialog. The Application State Code field contains all the 4Test code
you've just recorded. You can take the following actions:
Example
Here is a sample application state that performs the setup for all forward
case-sensitive searches in the Find dialog:
appstate Setup () basedon DefaultBaseState
TextEditor.File.New.Pick ()
DocumentWindow.Document.TypeKeys ("Test Case<Home>")
TextEditor.Search.Find.Pick ()
Find.CaseSensitive.Check ()
Find.Direction.Select ("Down")
Testing the application state
Before you run a testcase that is associated with an application state, you
should make sure the application state compiles and runs without error.
Procedure To test an application state:
1
Make active the window that contains the application state and select
Run/Application State.
The Run Application State dialog appears, shown in the following figure.
If Then
All the information in the
window is complete and
what you expect.
Click Paste to Editor. SilkTest closes the
Record Application State dialog and places
the new application state in your file.
You want to alter the code.
Edit the Application State Code field.
The application state name
is not what you want.
Edit the name in the Application State Name
field.
The application state on
which this application state
is based is not the one you
want.
Delete the code in the Application State Code
field, select a new application state from the
drop-down list, and click Resume Recording
to rerecord the application state.
The application state
routine is not finished.
Click Resume Recording. SilkTest opens the
Record Status window.