Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This operation will execute on all of the selected endpoints and will execute on each of the selected endpoints.

Additional

...

Information

Using global variables in FlexDeploy Opkey Plugin

Credential information or and other dynamic data for your test cases is are often passed at runtime to address enhance security concerns or because values may change frequently. This ensures that test cases don't need to be modified after they've accommodate frequently changing values. This approach eliminates the need to modify test cases once they’ve been created. To simplify streamline this process, Opkey provides the an option to pass these values using through a command parameter called the --global variable.

Now, let's take a Let’s look at an example of how this can be used applied in FlexDeploy.

Before you execute running the test suite, ensure that you have make sure you’ve created global variables in Opkey , such as FSMUserName,FSMPassword, which that can be mapped to your test casecases. These global variables are declared defined within Opkey and allow you to dynamically pass values dynamically at runtime during the test execution. For instanceIn this example, FSMUserName, and FSMPassword could be a are global variables that stores used to store a user’s login infocredentials, which will can then be referenced in your test casecases.

...

The FlexDeploy Opkey Plugin (runOpkeyTest operation) has a input option called Additional Arguments, which enables you to pass extra commands or parameters , including global variables, to the Opkey test during execution. You can specify these additional arguments in FlexDeploy while triggering the test. For exampleIf you are using out of box Opkey-runOpkeyTests, you can pass the global variable FSMUserName,FSMPasswordas a runtime parameter, allowing the test suite to dynamically use the value assigned to FSMUserNameand FSMPassword

Example 1

FlexDeploy enables secure passing of dynamic values, such as FSMUserName and FSMPassword, by referencing either Target Group Properties or Integration Instance Propertiesdefine the workflow inputOPKEY_INP_ADDITIONAL_ARGUMENTS for this purpose.

FlexDeploy supports referencing property values configured at Project, Target or Integration Instance levels. In FlexDeploy YAML configuration, Groovy evaluates these values first before they are passed into the setting groovy: true treats the value as a Groovy expression, which is evaluated before being passed to test workflow. This feature allows you to use directly reference the current target properties directly without qualifications, simplifying (Deploy or Utility execution target group) without needing to qualify them, streamlining the process.

However, when dealing with sensitive information like password properties, you do not want them to be evaluatedsuch as passwords, you should avoid evaluating these values, as they would otherwise be exposed in clear text. Instead, these sensitive values should be passed as environment variables, which requires qualifying the property with either the Target Group Code or Integration Instance Code, depending on where the property is locatedconfigured. Note that this applies to any other property that you want to reference as an environment variable.

For example, if you have a Cloud Account configured in FlexDeploy with properties for username and password, you can dynamically reference these properties and concatenate prefix them with the Target Group Integration Instance account code. This approach ensures that credentials are securely passed during test or deployment execution without exposing sensitive information.

...

Windows Example

Code Block
languageyaml
---
testName: Opkey Demo
description: Generated Opkey Test
workflow:
  name: Opkey-runOpkeyTests
  inputs:
    - code: OPKEY_INP_PROJECT_NAME
      value: Flexagon
    - code: OPKEY_INP_TEST_SUITE_PATH
      value: 'Project Workspace/FSM/FSM Validate'
    - code: OPKEY_INP_AGENT_NAME
      value: utlwt01
    - code: OPKEY_INP_PLUGIN_NAME
      value: OracleFusion
    - code: OPKEY_INP_ADDITIONAL_ARGUMENTS
      groovy: TRUEtrue
      value: '"--global-variable FSMUserName=%" + FDFSM_CLOUD_ACCOUNT_CODE + "_FDFSMACCT_USERNAME%,FSMPassword=%" + FDFSM_CLOUD_ACCOUNT_CODE + "_FDFSMACCT_PASSWORD%"'
    - code: TEST_INSTANCE
      value: OPKEYTEST    

...

Linux Example

Note use of \ to escape $ character in Groovy.

Code Block
languageyaml
---
testName: Opkey Demo
description: Generated Opkey Test
workflow:
  name: Opkey-runOpkeyTests
  inputs:
    - code: OPKEY_INP_PROJECT_NAME
      value: Flexagon
    - code: OPKEY_INP_TEST_SUITE_PATH
      value: 'Project Workspace\FSM\FSM Validate'
    - code: OPKEY_INP_AGENT_NAME
      value: utlwt01
    - code: OPKEY_INP_PLUGIN_NAME
      value: OracleFusion
    - code: OPKEY_INP_ADDITIONAL_ARGUMENTS
      groovy: TRUEtrue
      value: '"--global-variable FSMUserName=\$" + FDFSM_CLOUD_ACCOUNT_CODE + "_FDFSMACCT_USERNAME,FSMPassword=\$" + FDFSM_CLOUD_ACCOUNT_CODE + "_FDFSMACCT_PASSWORD"'
    - code: TEST_INSTANCE
      value: OPKEYTEST      

Test-Suite Execution Guide

Include Page
Opkey -TestSuite Execution Guide
Opkey

...

-TestSuite Execution Guide