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 / WLanguage / Sintaxis WLanguage / Palabras clave reservadas
  • Position of ON block
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
The ON keyword is used exclusively in the automated tests generated by WINDEV and WEBDEV. This keyword is used to avoid splitting the test scenarios (1 per window) when recording an automated test. ON indicates the window "on" which the specified actions will be applied.
Automatically generated tests contain the ON keyword. All the code with all the sequences and actions is visible in the same scenario, making it easier to read.
Ejemplo
EmulateMenu("_Menu", "Managing_the_contributors2")
EmulateMouse(WIN_CRM, dmLeftButtonDown, 354, 34)

// Scenario to run when opening the WIN_ManageContributor window
ON WIN_ManageContributor DO
EmulateMouse(WIN_ManageContributor.EDT_NAME, dmLeftButtonDown, 66, 33)
EmulateMouse(WIN_ManageContributor.EDT_NAME, dmLeftButtonUp, 62, 5)
EmulateInput(WIN_ManageContributor.EDT_NAME, "b")
EmulateMouse(WIN_ManageContributor.LSV_CONTRIBUTOR, dmLeftDoubleClick, 165, 61)

// Scenario to run when opening the WIN_AddContributor window
ON WIN_AddContributor DO
EmulateMouse(WIN_AddContributor.Title, dmLeftButtonUp, 112, -11)
EmulateMouse(WIN_AddContributor.BTN_CANCEL, dmLeftClick, 46, 14)
END

EmulateMouse(WIN_ManageContributor.BTN_CANCEL, dmLeftClick, 43, 9)
END
Sintaxis

Code to run during the window test Ocultar los detalles

ON <Window name> DO
  <Code to run>
END
<Window name>:
Name of the window opened by the automated test.
<Code to run>:
Code to run in the window opened by the automated test.

Code to run during the test of a dialog box or the test of a function that returns no result Ocultar los detalles

ON <Function name> RETURN
<WLanguage function name>:
Name of WLanguage function to run.
For example, to prevent from opening the dialog boxes of Error:
ON Error RETURN

Code to run during the test of a WLanguage function that returns a value Ocultar los detalles

ON <WLanguage function name> RETURN <Value>
<WLanguage function name>:
Name of WLanguage function to run.
For example:
ON fImageSelect RETURN fExeDir() + "\ExampleImage.jpg"
In this case, the function test is not run and fExeDir() + "\ExampleImage.jpg" is returned to the scenario.
<Value>:
Value that will be returned to the scenario.
Observaciones

Position of ON block

The ON block must be placed just after the call to the WLanguage functions that trigger the ON.
For example, the following code does not operate:
// Clicks the "Export to text format" option
EmulateMouse("WIN_Main.LAYOUT_EXPORT[1].BTN_EXPORT_TEXT", emLeftClick, 173, 37)
// Defines a test file
let sExportFile = fTempFile() + ".TXT"
ON fSelect RETURN sExportFile
You must use the following code:
// Defines a test file
let sExportFile = fTempFile() + ".TXT"
// Clicks the "Export to text format" option
EmulateMouse("WIN_Main.LAYOUT_EXPORT[1].BTN_EXPORT_TEXT", emLeftClick, 173, 37)
ON fSelect RETURN sExportFile
Versión mínima requerida
  • Versión 14
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 30/09/2024

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