GXtest UI Commands - Verify

Official Content
This documentation is valid for:

This command is useful to validate if a boolean value is true, setting optionally if test execution must be stopped when validation fails and a message identifying the validation.

verifyValue_png

verifyStop_png

verifyMsg_png

Works like an assertion but if the value is not true, then a screenshot of the web page is taken. If it's called with only one parameter, then the StopExecution value will be set to the Verify Stops Execution property's value on the current environment.

Parameters:

  • Value: the boolean value to check.
  • StopExecution: optional parameter indicating if the received parameter is not true then execution must be stopped or not. The default value is true.
  • Message: optional parameter to identify the validation done. Useful when seeing a test execution result.

Returns: 

This method doesn't return any value

Examples of use:

This command can be combined with several commands.

&driver.Verify(&driver.IsElementPresentByID("controlID"))

&driver.Verify(not &driver.AppearText("Not found"), false) 

&driver.Verify(not &driver.AppearText("Not found"), false, "Text 'Not found' was found") 

&driver.Verify(not &driver.AppearText("Not found"))

&driver.Verify(&driver.GetValueByName("controlName") = "Customer Name", false) 

&driver.Verify(&driver.GetValueByName("controlName") = "Customer Name", false, '&driver.GetValueByName("controlName") = "Customer Name"')

Availability

This set of commands is available since GeneXus 16 upgrade 10.

SetVerifyStopsExecution

SetVerifyStopsExecution_Command_png

Allows setting the default behavior for the Verify commands that only receives one parameter to ease a refactor on all the tests in case it is needed. Take into account that as a good practice this command should never be used explicitly inside a test because it implies that the test will not respect the global testing property designed for setting the Verify behavior, which also can be parameterized by MSBuild.

Parameters:

  • Value: the boolean value to set. When true, the tests are stopped at the moment a Verify command fails (if it has only one parameter).

Example of use:

&driver.SetVerifyStopsExecution(true)

&driver.SetVerifyStopsExecution(false)

Availability

This command  is available since GeneXus 17 upgrade 5.