SilkTest Training - D2

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

SilkTest: Basics and Beyond

Day 2
Application State

An application state is the state you want your


application to be in after the base state is restored but
before you run one or more testcases.
How “really” A Testcase Works ?
DefaultTestcaseEnter

Executes the application state chain associated with the testcase, from the
SetAppState base state up to the highest application state.

The application is running. The application is not minimized. The application


DefaultBaseState is the active application. No windows other than the application’s main
window are open.
BaseState
Chain of Application state

Executes chain of application states

Testcase

DefaultTestcaseExit

Calling SetBaseState for a testcase executes the statements associated with


SetBaseState the base state—that is, the application state at the bottom of the appstate
chain.
Recovery System

• Before the first line of your testcase begins running, the recovery system
restores the application to the BaseState even if an unexpected event
corrupted the application between testcases.

• During a testcase, if an application error occurs, the recovery system


terminates the execution of the testcase, writes a message in the error
log, and restores the application to the BaseState before running the next
testcase.

• After the testcase completes, if the testcase was not able to clean up after
itself (for example, it could not close a dialog it opened), the recovery
system restores the application to the BaseState.
Default Recovery System

Function Purpose
DefaultBaseState Restores the default BaseState, then call the application’s BaseState function, if defined.

Executed when a script file is first accessed.


DefaultScriptEnter Default action: none.

Executed when a script file is exited.


DefaultScriptExit Default action: Call the ExceptLog function if the script had errors.

Executed when a testcase is about to start.


DefaultTestCaseEnter Default action: Set the application state

Executed when a testcase has ended.


DefaultTestCaseExit Default action: Call the ExceptLog function if the script had errors, then set the BaseState

Executed when a test plan is entered.


DefaultTestPlanEnter Default action: none

Executed when a test plan is exited.


DefaultTestPlanExit Default action: none
Recording, Verifying, Debugging TC
Using Template of GUI Hierarchy
Bitmap
Control Statements
• If…Else Statement

• For Statement

• For each statement

• While statement

• Do..except statement

• Switch statement
Q?A

You might also like