TestWaitForStringInput
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DEFunction Syntax
long TestWaitForStringInput (char aQuery[]); // form 1long TestWaitForStringInput (char aQuery[], dword aTimeout); // form 2long TestWaitForStringInput(char text[], char caption[], char info[], char default[]); // form 3long TestWaitForStringInput(char text[], char caption[], char info[], char default[], dword timeout); // form 4long TestWaitForStringInput(char text[], char caption[], char info[], char regEx[], char default[]); // form 5long TestWaitForStringInput(char text[], char caption[], char info[], char regEx[], char default[], dword timeout); // form 6
Description
It creates a dialog which displays the transferred string. The tester can enter a text in this dialog. This entry can be queried with the command TestGetStringInput after a successful call, i.e. with the return value “1”. It is also possible to enter a comment in the dialog which is automatically adopted into the test report. The first wait function without timeout waits until the confirmation by the tester. If the second wait function is used with the timeout, the dialog is automatically closed after the timeout. Whether the dialog was closed due to a timeout or by the tester, can be determined by using the return value. The function TestGetLastWaitResult can be queried after calling the return value of the function if no otherTestWaitForStringInput call occurred in the interim.
Only one dialog is open at a time, even though TestWaitForStringInput is called by different test modules. You can optionally define some default input for the dialog or a regular expression for checking the input.
Parameters
- aQuery: Text to be displayed in the entry dialog.
- aTimeOut: Time in milliseconds after which the dialog is to be cancelled automatically.
- Text: Text to be displayed in the entry dialog.
- Caption: The title of the dialog.
- Info: Further information to be shown.
- Default: The default value for the input.
- regEx: Optional regular expression for the input.
- Timeout: Maximum time that should be waited [ms]. Transmission of 0: no timeout controlling.
Return Values
- < 0: General error, e.g. by calling outside of a test sequence
- 0: Timeout occurred
- 1: Dialog was closed by clicking the button [Ok] (successful call)
- 2: Dialog was closed by clicking the button [Cancel] (form 3-6)