AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / Pruebas / Pruebas automatizadas
  • Overview
  • Running the automated tests of an executable from WINDEV
  • Running the automated tests of an executable without WINDEV
  • Caution
  • Command line
  • Recording an automated test of an executable without WINDEV
  • "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
WINDEV proposes to run the different project tests directly on the corresponding executable. This allows you to run the test of an executable in real deployment conditions.
The principle is straightforward:
  1. A test robot (WDAutomate.exe) that operates with its own framework allows you to run the requested executable.
  2. The executable to test must be used in the same conditions as the ones experienced by the end users (including, if necessary, the access to the databases used or to an equivalent test database, the framework used, ...).
  3. To run the different tests, the executable whose test must be run loads a specific library containing the 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.
Running the automated tests of an executable 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. Run the tests on the executable: 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 the "Run the tests" button. The tests are automatically run and the result is displayed in the test robot.
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
    • wd290xx.dll
    • wd290test.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 WD290Test.DLL library that corresponds to the version of the executable.
Therefore, the WD290Test.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 the executable and the test library 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, <Script file path> 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>

    In this case, the result of the scripts will be in a <Results> tag in the script file.
Recording an automated test of an executable without WINDEV
The recording of a test scenario can be enabled by an entry in the .wx file of 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: wd290test.dll and wdtest.dll.
"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.).
The event "Automated test" of project allows you to use EmulateWindow to validate the window for example.
Versión mínima requerida
  • Versión 11
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 05/03/2024

Señalar un error o enviar una sugerencia | Ayuda local