Keyword |
Explanation and examples |
title |
Describes the test case. This is mandatory for every test case and must be the first keyword. The description is placed after the keyword. title Create, print, run example and delete |
timeout |
Specifies a timeout value for a test case. The timeout value is given in milliseconds. For example, a timeout of 10 seconds would be marked as: timeout 10000 |
priority |
Specifies the priority value of the test case. The value can be either an integer or the string "high", "normal" or "low". Negative values are low and positive values are high. For example, –100 is low, 0 is normal, 100 is high, 1000 is very high: priority high |
print |
Specifies a description to print, for example, to print progress information to the UI. The printed description is placed after the print keyword, as in the example in Test scripts. |
setresultdescription |
Sets the description of the current executed test case. In case of an error situation, it will be shown in the test report. setresultdescription object creation starts |
create |
Creates a new instance of a test class. This keyword has two mandatory arguments:
create TestScriptClass testObject |
createkernel |
Creates a new instance of a kernel test class. This keyword has two mandatory arguments:
createkernel TSKernelTest testObject |
delete |
Deletes an instance of a test class. Keyword has one mandatory argument:
delete testObject |
allownextresult |
Adds valid result values for a method and for asynchronous commands. The arguments for this keyword are Symbian platform error codes. The default value for the expected result is 0, and if a value is set with allownextresult, 0 is removed from the expected values. A method may either return or leave with the specified result. Every method call removes all allowed results. That is, after every method call, the default value 0 is again the only expected result value. Multiple allownextresult keywords can be placed before a method call and before the waittestclass keyword. allownextresult –1 |
allowerrorcodes |
Adds valid result values for a method and for asynchronous commands. The arguments for this keyword are Symbian platform error codes. As a default the expected result is 0 and if new value is set with allowerrorcodes, 0 will remain as an expected value. A method may either return or leave with the specified results. Every method call removes all allowed results. That is, after every method call, the default value 0 is again the only expected result value. Multiple allowerrorcodes keywords can be placed before a method call and before the waittestclass keyword. allowerrorcodes –1 |
waittestclass |
Pauses test case running until the specified test class object calls the Signal function to proceed with the test case execution again. Keyword has one mandatory argument:
waittestclass testObject |
pause |
Pauses test case running for a specified timeout (in milliseconds). That is, no further lines of the test case file will be executed during that delay, but the thread is not halted; any user active objects may still be completed and their RunL() called. For example, a pause of 10 seconds would be: pause 10000 |
loop endloop |
Repeats a section of the test case file for the specified number of iterations. The section to be repeated is enclosed with the loop and endloop keywords. Nested loops are not supported. Available arguments are:
For example, to execute a loop for 5 times: loop 5 // execute this 5 times |
oomignorefailure |
Used for OOM testing. Defines if a test class’s building block execution result is checked or ignored. Possible values are ON or OFF:
oomignorefailure on |
oomheapfailnext |
Used for OOM testing. Defines that heap allocation failure occurs in the test thread.
oomheapfailnext 0 |
oomheapsetfail |
Used for OOM testing. Defines that heap allocation failure occurs in the test thread. The user can define the failure type and count (rate).
oomheapsetfail deterministic 2 |
oomheaptonormal |
Used for OOM testing. Ends OOM testing and normal testing continues. This keyword can be used to initialize OOM parameters to the default ones. The oomheaptonormal keyword enables the test class’s building block execution result check and heap failures are not used anymore. |
testinterference |
Interferes the testing. It can take the following arguments:
Example of usage: #idle = 200 microseconds, active = 2 |
callsub |
Makes TestScripter executing pointed section of script. The section that will be called must start with [Sub name] and end with [EndSub] tags, where name is the identifier of the sub. The execution of the sub will continue until its end is reached. You can call a sub from another sub. [Test] |
request |
Requests an event. If someone wants to use an event, it must first be requested, and after that it can be waited. After the event is not used anymore, it must be released. The event name is a mandatory parameter. request Event1 |
wait |
Waits for an event. A request must be called before wait, and wait on the requested event blocks until the requested event is set. wait may proceed immediately if the requested event is a state event and already pending (for example, a phone call is already active). wait has one mandatory argument, which is the event name. wait Event1 |
release |
Releases an event. Every requested event must be released explicitly when it is not used anymore. release has one mandatory argument, which is the event name. release Event1 |
set |
Sets an event. Every set state event must be explicitly unset. The arguments are:
For example: set Event1 |
unset |
Unsets a state event. Every set state event must be unset. Indication events cannot be unset. Unset of a event blocks until everyone who has requested the specified event has released the event. The mandatory argument is the event name. unset Event1 |
bringtoforeground |
Brings the UI component container to foreground. |
sendtobackground |
Sends the UI component container to background. |
presskey |
Sends a key event to the tested UI component. It has one mandatory parameter, which is the key code (a single character or constant defined in the TKeyCode enumeration). Also other, optional parameters can be used. presskey a |
typetext |
Sends text to the tested UI component. The text that should be sent to the UI components must be in double quotation marks. typetext “Text to send” |
measurement |
Measures the testing. Arguments:
|
var |
Assigns a text value to a specified variable. It can be then used in other parts of the script. var Name Value |
sendpointerevent |
Sends pointer events to the tested UI component. Arguments:
sendpointerevent EventType Xco-ordinate Yco-ordinate |
using |
Loads an STF specific test harness library. Arguments:
|
expectedpanic |
Declares a valid panic resume value for the test case. Arguments:
expectedpanic XXXX |
createshareobj |
Creates an object, wihch can be shared with other test cases in the same test script file. Arguments:
createshareobj ClassName ObjName |
restoreshareobj |
Restores an object, which has been created by the createshareobj keyword. Arguments:
|
deleteshareobj |
Deletes an instance of a test class created with createshareobj. Arguments:
|
file |
Specifies a data file name. Arguments:
|
section |
Specifies which section in the data file will be referred to by the test case. Arguments:
|
canceliferror |
Cancels the execution of the remaining test cases if one of the executed test cases has failed. This keyword is normally used to stop the test case execution when some of the test cases are long running. [Test] |
run |
Starts a specified test case. It has several mandatory and optional arguments. The mandatory arguments are:
Optional arguments contain, for example, testid (identification for the test case), ini (initialization file for the test module) and category (normal, leave, panic, exception or timeout). For example: run netmodule net.cfg 5 testid=test1 expect=3 ini=ini.txt |
cancel |
Cancels a running test case. The test case is cancelled by immediately killing the thread that executes the test case. The keyword has one mandatory argument, the test ID. cancel test1 |
pausetest |
Pauses a test case. The test case is paused by pausing the thread that executes the test case. The pausetest keyword has one mandatory argument. pausetest testid time Arguments:
For example:
|
resume |
Resumes a paused test case. Has one mandatory argument, the test ID. resume test1 |
complete |
Waits and blocks a running test case. This keyword is used to have a started test case wait to complete and blocks until the test case has finished. Has one mandatory argument, the test ID. complete test1 |
allocate |
Allocates a slave, for example, for running a test case on a remote phone. It uses Remote Control Protocol (RPC). The slave must always be allocated first before it can be used.
For example: allocate phone MySlave |
free |
Frees a slave. Every allocated slave must be freed with free when it becomes unused. It has one mandatory argument, the slave name. free MySlave |
remote |
Starts the execution of a test case in a slave and also requests and releases events from the slave. Other controlling for remote test cases is done with the same keywords as for the local test cases.
For example: remote MySlave run netmodule net.cfg 5 testid=test1 expect=3 ini=ini.txt |
INCLUDE |
Includes a file
|