- How to create the test?
- Creating an automated test on a window
Automated tests of window
The automated tests of window are used to check the different features proposed by the window.
Creating an automated test on a window
To create an automated test on a window:
- Open the window whose test must be run in the window editor.
- On the "Automated tests" tab, in the "Tests" group, expand "New" and select "Record a new scenario".
- An information dialog is displayed, indicating that the window will be run in test mode and that all the operations performed from now on will be recorded in WLanguage in the test scenario.
- Click the "Start recording" button to validate.
Remark: If the window expects parameters, type the test values of window.
- Perform the necessary operations in your window.
- To stop the test, close the window.
- At the end of the test, the test description window is displayed. You have the ability to specify the test name and its description ("General" tab). The information available on the other tabs is specified by default. This information can be modified at any time.
- The code corresponding to the test is displayed in the code editor.
- If a window is opened from the "Initializing" event of the project, a test is also created for this window. The event "Automated test" of the project is modified to take into account the test of this window.
- If your application uses the user groupware:
- in manual mode: if gpwOpen is used, this function must be replaced with gpwLogin in the test code.
- in automatic mode: in the configuration window of user groupware, specify the login and password that will be used for the automatic test mode.
- If the window whose test is run opens another window (or an internal window), the operations performed in the different windows are recorded in the same scenario.
- If the window opens another window found in a component, the operations performed in the component window will also be recorded in the same scenario.
Caution: No automated test can be created if a window coming from a component is opened in the initialization code of project.
- No test can be run on the Carousel control.
- No test can be run on the windows automatically displayed by WINDEV (windows for managing HFSQL errors, print windows, ...). If these windows are included in the project in order to be customized, the automatic test can be run.
- The operation used to Drag and Drop a control to another one cannot be replayed in an automatic test.
- The recording of a scenario ignores the persistence of controls. Indeed, if this was not the case, the context and therefore the result could be different between two tests passed at two different moments.
- When an automated test is run on an organizer control, the selection of the period with the mouse must be performed without scroll.
- You cannot run the test of a print via the print preview. The code automatically generated to manage the "Preview" window must be deleted from the test code.
Training (WINDEV): WD Example of unit test
This page is also available for…