ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Test
  • Overview
  • Testing and debugging the current project
  • Testing a project
  • Remark: Minimizing (or not) the editor during the test
  • Configuring the test mode
  • Running and debugging the executable on the development computer
  • Debugging an executable already run on the development computer
  • Starting the debugger and stopping the test
  • Starting the debugger
  • Stopping the test
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The test of the entire project allows you to simulate the start of the application with the executable. This allows you to test the entire application, even if it is still being developed. When a problem occurs during the execution of the project, you can start the debugger to identify and fix the problem.
WINDEV includes an extensive set of application tests that can be run from the development computer:
Remark: The test of a project can be run regardless of the current element in the editor.
Testing and debugging the current project

Testing a project

To test a project from the editor:
  1. On the "Project" tab, in the "Test mode" group, expand "Test mode" and select "Debug project" (Ctrl + F9). You also have the ability to click in the quick access buttons.
  2. If the first project window was not defined, a window is displayed, allowing you to select the first project window.
  3. The editor is automatically minimized and the project is run.
At the start of the project test, before opening the first window of the project, the following WLanguage events are run:
  • declaring classes,
  • initializing the project,
  • declaring the global variables of the first window,
  • initializing the first window,
  • initializing the controls found in the first window,
  • gaining focus (first window),
  • entering the first control of the first window (if this control is associated with a WLanguage entry event).

Remark: Minimizing (or not) the editor during the test

During a test, the editor is minimized by default. Depending on the hardware configuration (wide screen, 2 screens, etc.), you may not need to minimize the editor.
To keep the editor opened:
  1. On the "Home" tab, in the "Environment" group, expand "Options" and select "Options of the code editor".
  2. In the "Debugger" tab, uncheck "Minimize editor in test mode".
  3. Validate.

Configuring the test mode

To configure the test mode, go to the "Project" tab, "Test mode" group, expand "Test mode" and select "Configure test mode".
For more details on the different options, see Options of test mode.
Running and debugging the executable on the development computer
Some problems can only be reproduced when testing the executable in real-use conditions. This test mode allows you to debug an executable once it is installed on the development computer. In this case, the code executed comes from the libraries (and not from the code in the elements on the computer). Therefore, the code from the current project and the code from the executable may be out-of-sync: the out-of-sync code is highlighted in pink during the debug operation.
To run and debug the executable:
  1. Open the project associated with the executable in the editor.
  2. On the "Project" tab, in the "Test mode" group, expand "Test mode", go to "On an executable", and select "Run".
  3. Specify the options that must be taken into account during the test:
    • the executable to run. This executable must correspond to the project opened in the editor.
    • the command line to run (if necessary).
    • the Windows account that must be used to start the executable. If this account differs from the current user, the user must have been defined on the current computer. His login, his password and his domain must be specified.
  4. Validate. The test is run.
Remark: In this mode, InTestMode returns False.
Debugging an executable already run on the development computer
Some problems can only be reproduced when testing the executable in real-use conditions. This test mode allows you to find a problem that only occurs at runtime (and not in test mode). In this case, the code executed comes from the libraries (and not from the code in the elements on the computer). Therefore, the code from the current project and the code from the executable may be out-of-sync: the out-of-sync code is highlighted in pink during the debug operation.
To debug an executable that is already run:
  1. Open the project associated with the executable in the editor.
  2. A breakpoint can be included in the code that triggers the debugger.
  3. On the "Project" tab, in the "Test mode" group, expand "Test mode, go to "On an executable", and select "Attach to a running executable".
  4. The window that is displayed lists all WINDEV executables currently run. Select the executable to debug.
  5. Validate. The debugger is linked to the executable run.
Remark: In this mode, InTestMode returns False.
Starting the debugger and stopping the test

Starting the debugger

Several methods can be used to start the debugger during the test of the executable:
  • Pressing Ctrl + Pause. The action performed once the Ctrl + Pause keys have been pressed (click on a button, ...) will start the debugger. This method can be used before performing a click on a button for example.
    This method can also be used to start the debugger when a long process (containing Multitask statements) seems to loop endlessly.
  • Starting the debugger from the editor. In this case, perform the following operations:
    • Click the WINDEV icon in the taskbar.
    • In "Do you want to stop the test?", select "No".
    • Go to the "Debugger" pane, "Debug" group, and click the icon.
A breakpoint can also be included in the code editor in front of the desired line of code. The debugger will be automatically displayed when the corresponding line is run.
Once the debugger is running:
  • the WINDEV code editor displays the "Debugger" tab. The text of the tab is shown in red.
  • the status bar is shown in orange.
For more details on the debugger, see Running a project step by step.

Stopping the test

There are multiple methods to stop the test:
  • 1st method: Close the application being tested. WINDEV goes back to editor that was open when the test was started.
  • 2nd method: Go back to the editor with the taskbar (or press Alt + Tab) and confirm the end of the test. WINDEV goes back to editor that was open when the test was started.
Remark: If changes have been made to the UI during the project test (e.g. resize or move controls), at the end of the test, WINDEV allows you to change the interface of the corresponding windows. For more details, see Using the UI modification during a project test.
Minimum version required
  • Version 12
Comments
Click [Add] to post a comment

Last update: 05/05/2023

Send a report | Local help