ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / Developing an application or website / Test / Automated tests
  • Overview
  • Running the automated tests of an executable
  • Method 1: Launch automatic executable tests from WINDEV
  • Method 2: Running the automated tests of an executable without WINDEV
  • Caution
  • Command line
  • Record the automatic test of an executable
  • Recording with WDAutomate
  • Recording via a WX file
  • Recording via dbgEndRecording / dbgEndRecording functions
  • "Automated test" event of the project
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
Using the WDAutomate application, WINDEV offers the following functions:
  • launch the various tests of a project directly on the corresponding executable. This allows you to run the test of an executable in real deployment conditions.
  • Record tests directly on an application.
Running the automated tests of an executable
Here's how it works:
  1. A test robot (WDAutomate.exe) that operates with its own framework allows you to run the requested executable.
  2. The executable to be tested must be in the conditions in which it will be used by end-users (including, if necessary, access to the databases used or to an equivalent test database, the framework used, etc.).
  3. To run the different tests, the executable whose test must be run loads a specific library containing the tests:
    • unit tests,
    • application tests.
  4. The tests are run and the result is saved in the Control Centers. The result can be displayed:
    • from the test robot (by selecting the executable and the test library).
    • from WINDEV (for the project version used to create the executable).
Remark: The automated tests do not operate on a non-interactive TSE session.

Method 1: Launch automatic executable tests from WINDEV

To directly run the automated tests on an executable from WINDEV:
  1. Create the executable: expand in the quick access buttons and select "Generate the Windows executable (32 bits)" for example.
  2. Generate test library: on the "Automated tests" tab, in the "Automated test" group, click "Generate library". The test library has the following format: TEST_<ProjectName>.WDL. This library is created in the "Data of automated tests" subdirectory of the project.
  3. Launch the test Robot, WDAutomate: on the "Automated tests" tab, in the "Automated test" group, click "Start the automated test".
    In this window, you must select:
    • The relevant product (WINDEV).
    • The executable whose test must be run.
    • The test library to use.
    • The command line (if necessary).
    • The tests to run.
      Remark: If the executable contains internal components, the automated tests of these internal components also appear in the list of tests that can be executed.
  4. Click on the "Run selected tests" button. The tests are automatically run and the result is displayed in the test robot.

Method 2: Running the automated tests of an executable without WINDEV

The automated tests of a WINDEV executable can be run without the corresponding product being installed on the current computer. However, some files are required:
  • Files required to start the test robot:
    • WDAutomate.exe
    • WDOutil.wdk
    • wd300xx.dll
    • wd300test.dll
  • Files required to save the results of tests: Data files of Control Centers. At least one Control Center must be installed on the computer.
    The data files of Control Centers must be the ones used on the development computer (to be able to see the result of the tests). Several cases may occur:
    • if the Control Centers use a Client/Server database, the data of the Control centers is shared between the computers.
    • if the Control Centers use a HFSQL Classic database in network, the data of Control Centers is found in a shared directory.
  • Executable to test with its framework (and the accesses required for the test).
  • Test library and test data (the "Data of automated tests" subdirectory of the project must be copied to the computer)
The result of the automated tests can be directly viewed in WINDEV: to do so, open the project corresponding to the executable.

Caution

To test an executable created with a previous version of WINDEV, the test robot must have access to the WD300Test.DLL library that corresponds to the version of the executable.
Therefore, the WD300Test.DLL library must be copied in the same location as WDAutomate.exe.

Command line

There are two syntax options to use WDAutomate in command line:
  • Syntax 1: Passing executables and test libraries directly:
    WDAutomate [/EXE=<Nom et chemin de l'exécutable a tester>]
    [/WDL=<Nom et chemin de la bibliothèque de tests automatiques>]
  • Syntax 2: Using a script file:
    WDAutomate [/SCRIPT=<Chemin du fichier de script>]
    In this case, corresponds to a text file in XML format with the following content:
    <?xml version="1.0"?>
    <Script>
    <EnsembleTest>
    <EXE>Nom et chemin de l'exécutable à tester</EXE>
    <LC>Ligne de commande à passer à l'exécutable</LC>
    <WDL>Nom et chemin de la bibliothèque de tests automatiques</WDL>
    </EnsembleTest>
    </Script>

    The result of the launched scripts will be present in a Tag of the script file..
    The Tag is of the form:
    <Resultats>
    <Test Nom="Nom du test Valide" Passage="numéro de passage" Resultat="OK"/>
    <Test Nom="Nom du test Invalide" Passage="numéro de passage" Resultat="KO">
    <Iteration Num="Numéro itération">Message décrivant l'erreur</Iteration>
    </Test>
    </Resultat>
Record the automatic test of an executable

Recording with WDAutomate

WDAutomate tool for recording automatic application tests.
To record an application test with WDAutomate:
  1. Launch WDAutomate: on the "Automated tests" tab, in the "Automated test" group, click "Start the automated test".
  2. Select the executable to test. If necessary, enter the required command line.
  3. Click on the "Save a new test" tab.
  4. Click on the "Launch application and save operations" button.
  5. The application starts: you can carry out any manipulations that need to be tested.
  6. When you close the application, WDAutomate offers to save the scenario Receiver corresponding to the operations carried out. The default path is: "C:\Users\nom_user\AppData\Roaming\PC SOFT\Nom_Appli\WDAutomate\scenarios\Scénario.wsct".
This file can be opened in the Test Manager:
  • directly by dragging and dropping the file into the editor.
  • or via the ribbon: in the "Automated tests" pane, in the "Tests" group, pull down "New" and select "Import a scenario saved on the application".
An "application test" type test list is created, containing the recorded scenario. You can change the name of the test list and the name of the scenario..

Recording via a WX file

The recording of a test scenario can be activated by an entry in the application's .wx file.
This scenario corresponds to an application test that can be opened in the test editor:
  • directly by dragging and dropping the file into the editor.
  • or via the ribbon: in the "Automated tests" pane, in the "Tests" group, pull down "New" and select "Import a scenario saved on the application".
Reminder: The .wx file must be used to configure some features of the executable. It must have the same name as the .EXE file and be located in the same directory. Its extension is.wx (uppercase or lowercase characters).
The following section must be added to the .wx file:
[SCENARIO]
ACTIF=1
FICHIER=<nom et chemin du fichier scénario de test à enregistrer
(ce fichier doit porter l'extension .wsct)>
CHEMINDLL=<chemin des dll nécessaires à l'enregistrement de scénario>
This method can be used if the executable does not use the same version of the DLLs as the test robot (WDAutomate.exe) and therefore the two applications cannot be found in the same directory.
Two additional DLLs are required to record the test: wd300test.dll and wdtest.dll.

Recording via dbgEndRecording / dbgEndRecording functions

Functions dbgStartRecording / dbgEndRecording are used to create a test scenario..
This scenario corresponds to an application test that can be opened in the test editor:
  • directly by dragging and dropping the file into the editor.
  • or via the ribbon: in the "Automated tests" pane, in the "Tests" group, pull down "New" and select "Import a scenario saved on the application".
"Automated test" event of the project
WINDEV allows you to enable (or not) the "Automated test" event of the project. On the "Automated tests" tab, click in the "Tests" group and select:
  • "Enable the code of automatic test for the project".
  • "Disable the code of automatic test for the project".
In the case of an automated test, this event is run before the project initialization code. This code us used to process some special cases where the automated test may be locked: opening a window in the project initialization code (settings, license agreement, custom login window, etc.).
Minimum version required
  • Version 11
Comments
Click [Add] to post a comment

Last update: 07/03/2024

Send a report | Local help