Test Preferences

Official Content
This documentation is valid for:

This section documents test options that can be configured inside the GeneXus IDE, and their behavior. 

Some test options are specific to an Environment, and others are set per Knowledge Base.

Environment Test Properties

You need to open the environment preferences to set Test properties on it:

webTestEnvProps_PNG

General environment testing options

Generate Code Coverage Information: {No, Yes}
If the value is Yes, GeneXus generates source-level runtime code coverage information. Default: No

Run Tests After Build: Boolean
When true, after running a Build or Rebuild All operation in GeneXus IDE, this option will start running all test cases automatically.  Default: False

Web environment testing options

Full page screenshot: Boolean
Defines default TakeScreenshot command behavior. If set to true, the webdriver will take a screenshot of the whole page and not only the section within the viewport.

Base URL: String
Set the base URL to open when UI tests don't have a complete URL specified. Default: Environment's web root (set at first execution).

Verify stops execution: Boolean
Defines default Verify command behavior. If set to true, test executions will stop after a failed Verify check.

Screenshot saving mode: {Never, OnError, OnWarning, OnVerifyAndError, Always}
Allows setting the conditions when a screenshot is taken and saved during web UI tests execution. Default: OnError

  • Never: screenshots are never taken.
  • OnError: screenshots are taken only when a command fails.
  • OnWarning: screenshots are taken only when a command fails or has a warning state.
  • OnVerifyAndError: screenshots are taken only when a command fails or the command is a Verify command (regardless of whether it fails or not). "Always on errors and always on Verify commands".
  • Always: screenshots are taken for all commands (except for the CloseWindow command since screenshots are taken after the command is performed)

Html saving mode: {Never, OnError, OnWarning, OnVerifyAndError, Always}
Allows setting the conditions for when the page's HTML should be saved during web UI tests execution. Default: OnError
For descriptions about available options see the previous setting where those are explained.

File Upload Base Path: String (for UI tests only)
Allows setting a directory as a base path to locate all resources that will be used on FIleUpload commands. When running web tests, this property is combined with the FilePath parameter in FileUpload commands.

KB Version Test Properties

You need to open the KB Version properties and scroll down to Test group properties:

TestingProps_KBVersion_png

KB version general testing options

Version: String 
Read-only property that shows the GXtest Framework version. GXtest framework is Runner and external objects for UI automation (web and SD)

KB version web testing options

Default Browser: String
The default browser when starting a UI test. If you don't explicitly define a browser type using the SetBrowser command, this browser will be selected.  Default: Chrome

Arguments: String
Allows setting special command-line arguments for a web browser. Separate each argument with an space character.

Every browser accepts its own startup arguments:

KB Version Unit Test Generation Properties

GXtest allows you to determine data, algorithm, and the number of test cases to be generated for unit tests. 

Algorithm { RandomCombination, CartesianProduct, Pairwise }

Allows the user to choose the algorithm used to combine input values for every parameter. This will be reflected in the amount and how exhaustive test cases will be. Default: Random combination.

Random combination: test cases are built using random values for each parameter

Cartesian product: all possible combinations between parameter values are made. The number of test cases will be the product of data values count for every parameter. For instance, if the object has 3 parameters and you input 5 values for each parameter, there will be 5*5*5 test cases: 125.

You can find information at Pairwise combination 

Parameter values { Autogenerated, Prompt }

This option allows to custom-select data used on test generation, either random (autogenerated) or user-specific (prompt). Default: Autogenerated.

Autogenerated: values sets are built using a mix of fixed and random values for every parameter depending on the parameter’s data type.

Prompt: Before creating the test, a window is prompted to the user, which enables the user to use specific data. Please refer to this article to understand how to generate different sets of data for tests.

Data sets count: Numeric

Set how many data sets will be generated in the test DataProvider, after clicking the "Create Unit Test" option. For the Random Combination algorithm only.

Default: 5

Note: Also there are other settings (low level) that can be set via GXtest config file

Test object properties

In order to access these, you can right-click on a Test Object in the KB Explorer and select properties to open the KB Test object properties.

Enabled: Boolean

Defines whether the test will be taken into consideration when Rebuild All Tests or Run All Tests options are used. When false, the test will be ignored in these instances. 

 

Domain Test Values

This feature allows the user to define comma-separated test values to be used when generating unit tests from procedures. This comes in handy if for defining edge, failing and working cases, in order to ensure that the autogenerated tests will test all of those scenarios.

In order to define it, we need to access the domain's properties after creation and populate the Test Values property. In order to make the most of this feature, we recommend combining it with either Pairwise or Cartesian Product generation algorithms, to ensure all defined test values are used.