PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • How to create the test?
  • Creating an automatic test on a window
  • Changing the test of a window into automatic test
  • Notes
  • Limits
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Overview
The automatic tests of window are used to check the different features proposed by the window.
Note: Use in Windows Vista (and later): To record and replay the automatic unit tests, the UAC mechanism must be disabled.
How to create the test?

Creating an automatic test on a window

To create an automatic test on a window:
  1. Open the window whose test must be run in the window editor.
  2. Select "Automatic tests .. Record a new test" ( ).
    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.
    On the "Automatic tests" pane, in the "Tests" group, expand "New" and select "Save a new test".
    On the "Automatic tests" pane, in the "Tests" group, expand "New" and select "Save 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.
    Note: If the window expects parameters, type the test values of window.
  3. Perform the necessary operations in your window.
  4. To stop the test, close the window.
  5. At the end of the test, the description window of the test is displayed. You have the ability to specify the name of the test and its description ("General" tab). The information available on the other tabs is specified by default. This information can be modified at any time.
  6. The code corresponding to the test is displayed in the code editor.

Changing the test of a window into automatic test

When developing a WINDEV application, the easiest test consists in performing a GO on a window and in checking the features of this window. If the test of the window is completed without error, you have the ability to save the operations performed during the test in an automatic test.
To run the test of the current window from the editor:
  1. Select "Code .. Run the window test" (or press [F9] or click "GO"). The editor is automatically minimized and the window is run.
  2. Stop the test (close the application for example or go back to the editor).
  3. When going back to the editor, click .
  4. The automatic test is automatically added to your project. The description window of the automatic test is displayed.
  5. Specify the name of the test and its description if necessary.
  6. Validate.

Notes

  • If a window is opened from the initialization code of project, a test is also created for this window. The "Automatic test" process of project is modified to take the test of this window into account.
  • If your application is using the user groupware:
    • in manual mode: if gpwOpen is used, this function must be replaced by gpwLogin in the test code.
    • in automatic mode: in the configuration window of the user groupware, specify the login and the 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 automatic test can be created if a window coming from a component is opened in the initialization code of project.

Limits

  • 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 automatic 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.
Related Examples:
WD Example of unit test Training (WINDEV): WD Example of unit test
[ + ] This example presents the use of the test editor included in WINDEV:
- test of a window
- test of a global procedure
- test of a global procedure from a set of test data (available from the versions 12)
Minimum required version
  • Version 11
This page is also available for…
Comments
Click [Add] to post a comment