Extending the Execution Context

A test scenario is normally environment independent which means that the test scenario can be reused across environments without any changes. This is the general case. In some cases you might need environment specific information in a test scenario, and the test scenario might need to behave differently depending on the environment in which its being executed. With Functional Test it is possible to define custom data extensions that extend the Execution Context and environments. This allows administrators to define the data values at all environments and developers to use or override these when executing test scenarios. The values will be available as variables in the test scenario when it executes. These variables can then be used to for example, setup the execution of a component or used in an If element to only execute part of the test scenario depending on the environment.

As before let us illustrate this with an example.

  1. At the Data Extensions page, add a new Data Extensions, select the Extension Type to be Execution context, and fill in some values as illustrated below. Click Create.

inset_2.jpg
  1. Select an environment, click Edit and set the testvar variable that now appears as an input field. In this example we set the value to FromEnvironment12. Click Update.

inset_3.jpg
  1. Data extensions are only synchronized to Eclipse at startup, so restart Eclipse and execute any test scenario. In the Execution dialog see that now the testvar data extensions appear in the dialog and the default value from the environment is shown.

inset_4.jpg
  1. Execute the test scenario and look into the log where you now see that the testvar value is available as a variable

inset_5.jpg