background image
<< Recovery System - Handling login windows | Recovery System - Overriding the default recovery system >>
Recovery System - Adding to the default base state
<< Recovery System - Handling login windows | Recovery System - Overriding the default recovery system >>
298
User's Guide
15 U
NDERSTANDING
THE
R
ECOVERY
S
YSTEM
Adding to the default base state
Example
After following this procedure, your test frame might look like this:
window MainWin MyApp
tag "My App"
const wStartup = Login
// the declarations for the MainWin should go here
Invoke ()
derived::Invoke ()
Login.Name.SetText ("Your name")
Login.Password.SetText ("password")
Login.OK.Click ()
window DialogBox Login
tag "Login"
// the declarations for the Login window go here
PushButton OK
tag "OK"
About the derived keyword and scope resolution operator Notice the
statement derived::Invoke ( ). That statement uses the derived keyword
followed by the scope resolution operator ( :: ) to call the built-in Invoke
method, before performing the operations needed to fill in and dismiss the
login window.
For more information about the scope resolution operator, see online Help.
Adding to the default base state
As described in "The recovery system's flow of control" on page 291,
SilkTest by default considers your application to be at its base state when:
·
The application is running
·
The application is not minimized
·
The application is active
·
No other window besides the main window is open
If you want the recovery system to perform additional steps after it restores
the default base state, you need to record a new method named BaseState and
paste it into the declaration for your application's main window.
How to record a
BaseState method for
the main window
Procedure To record a BaseState method, SilkTest provides the Record
Method dialog.
1
Open your application.
2
Open the application's test frame file.