Keyword |
Explanation and usage 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 |
Used to give a timeout value for a test case. The timeout value is given in milliseconds. For example, timeout of 10 seconds would be marked as: timeout 10000 |
priority |
The priority value of the test case is 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 |
Can be used to print, for example, progress information to the UI. The printed description is placed after the print keyword, as in the example in Test scripts. |
setresultdescription |
Can be used to set description of currently executed test case. In case of an error situation, it will be shown in the test report. setresultdescription object creation starts |
create |
Used to create a new instance of a test class. This keyword has two mandatory arguments:
create TestScriptClass test |
createkernel |
Used to create a new instance of a kernel test class. This keyword has two mandatory arguments:
createkernel TSKernelTest test |
delete |
Used to delete an instance of a test class. Keyword has one mandatory argument:
delete test |
allownextresult |
Used to add valid result values for a method and for asynchronous commands. The arguments for this keyword are Symbian OS 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 |
The allowerrorcodes keyword is used to add valid result values for a method and for asynchronous commands. The arguments for this keyword are Symbian OS 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 |
Used to pause 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 test |
pause |
Used to pause 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 |
Used to repeat 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 |
Object name |
The test object name can be considered as a temporary keyword, which is valid between its creation with the create keyword and its deletion with the delete keyword. The object name is used to call methods from a test object. The method name is given as the first argument for the object name, and the method may have arguments, which are forwarded to the test class method. TestObjectName MethodName <method arguments 1 2 3> |
oomignorefailure |
Used for OOM testing. This keyword 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. This keyword defines that heap allocation failure occurs in the test thread.
oomheapfailnext 0 |
oomheapsetfail |
Used for OOM testing. This keyword 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. This keyword 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 |
The testinterference keyword is used for test interference testing. It can take the following arguments:
Example of usage: #idle = 200 microseconds, active = 2 |
testmeasurement |
Used for test measurement testing. It can take the following arguments:
testmeasurement start stifmeasurementplugin02 c:\ConfigurationInfo.txt |
callsub |
The callsub command makes TestScripter executing pointed section of script. A 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. There is possibility to call a sub from another sub. [Test] |
request |
Used to request 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 |
Used to wait for an event. A request must be called before wait, and wait 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 |
Used to release 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 |
Used to set an event. Every set state event must be explicitly unset. The arguments are:
For example: set Event1 |
unset |
Used to unset a state event. Every set state event must be unset. Indication events cannot be unset. unset blocks until everyone who has requested the specified event has released the event. The mandatory argument is the event name. unset Event1 |
bringtoforeground |
The bringtoforeground keyword is used to bring UI component container to foreground. |
sendtobackground |
The sendtobackground keyword is used to send UI component container to background. |
presskey |
The presskey keyword is used to send key event to tested UI component. It has one mandatory parameter, which is the key code (a single character or constant defined in TKeyCode enumeration). Also other, optional parameters can be used. presskey a |
typetext |
The typetext keyword is used to send text to tested UI component. The text that should be sent to the UI components must be in quotation marks. typetext “Text to send” |