Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Application States & Test Plan

Application States & Test Plan

Ratings: (0)|Views: 104|Likes:
Published by api-3736193

More info:

Published by: api-3736193 on Oct 15, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

Jagan Mohan Julooru
APPLICATION STATES & TEST PLANS
SILK TEST 7.5
Jagan Mohan Julooru
OVERVIEW OF APPLICATION STATES

When testing an application, you\u2019re likely to have a number of testcases that have identical setup steps. Rather than record the same steps over and over again you can record the steps as an application state and then associate the application state with the relevant testcases.

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. By creating an application state, you are creating reusable code that saves space and time. Furthermore, if you need to modify the Setup stage, you can change it once, in the application state routine.

A testcase can have, at most, one application state associated with it. However, that application state may itself be based on another previously defined application state. For example, assume that:

\u2022
The testcase Find is associated with the application state Setup
\u2022
The application state Setup is based on the application state OpenFile
\u2022
The application state OpenFile is based on the built-in application state,
DefaultBaseState
\u2022
SilkTest would execute the programs in this order:
1
DefaultBaseState application state
2
OpenFile application state
3
Setup application state
4
Find testcase

If a testcase is based on a single application state, that application state must itself be based on DefaultBaseState in order for the testcase to use the recovery system. Similarly, if a testcase is based on a chain of application states, the final link in the chain must be DefaultBaseState. In this way, SilkTest\u2019s built-in recovery system is still able to restore the application to its base state when necessary.

DefaultBaseState

Built-in application state function that returns your application to its base state. By default, the built-in DefaultBaseState ensures that the application is running and is not minimized, the main window of the application is open, and all other windows (for example, dialogs and messages boxes) are closed.

Jagan Mohan Julooru
BASESTATE
The known, stable state you expect the application to be in at the start of each testcase.
APPLICATION STATE BASED ON NONE

If an application state is based on the keyword NONE, SilkTest executes the application state twice: when the testcase with which it is associated is entered and when the testcase is exited.

On the other hand, if an application state is based on DefaultBaseState, SilkTest executes
the application state only when the associated testcase is entered.
The following example code defines the application state InvokeFind as based on the
NONE keyword and associates that application state with the testcase TestFind.

Appstate InvokeFind () basedon none
xFind.Invoke ()
print ("hello")

testcase TestFind () appstate InvokeFind
print ("In TestFind")
xFind.Exit.Click ()

When you run the testcase in SilkTest, in addition to opening the Find dialog, closing it,
and reopening it, the testcase also prints:

hello
In TestFind
hello

The testcase prints hello twice because SilkTest executes the application state both as the
testcase is entered and as it is exited.
RECORDING AN APPLICATION STATE

You define an application state before recording the testcase(s) associated with it. As with testcases, you can write an application state routine from scratch or you can use the Application State command on the Record menu.

\u2022

Open the file in which you want to place the application state. This can either be the test frame file for the application or the script file where the associated testcases are defined. If you put the application state in the test frame file, it will be available to all testcases. If you put it in the script file, it will be available only to testcases in that script file.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->