> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# runOpkeyTests

> Opkey is a no code continuous testing platform for web, mobile, and ERP applications. It enables businesses to automate test case generation, accelera

Opkey is a no-code continuous testing platform for web, mobile, and ERP applications. It enables businesses to automate test case generation, accelerate regression cycles, enhance test coverage, and reduce costs. Recognized by industry analysts like IDC, Gartner, and Forrester, Opkey is transforming the future of test automation.

FlexDeploy's `runOpkeyTest` operation enables seamless Opkey integration, allowing teams to execute test suites and review results directly within FlexDeploy. This integration streamlines testing within CI/CD pipelines, ensuring software quality and faster delivery.

# Test Instance Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Opkeyone Server URL</td><td>`FDOPKEY_SERVER_URL`</td><td>Yes</td><td>Provide Opkeyone server URL. (ex:` https://hostname.opkeyone.com/`)</td></tr><tr><td>Opkey User Name</td><td>`FDOPKEY_USERNAME`</td><td>Yes</td><td>Provide Opkey username.</td></tr><tr><td>Opkey Password</td><td>`FDOPKEY_PASSWORD`</td><td>Yes</td><td>Provide Opkey password.</td></tr><tr><td>Opkey CLI jar path</td><td>`FDOPKEY_CLI_JAR_PATH`</td><td>Yes</td><td>Provide Opkey jar path. (ex: `C:/opk/OpKeyCLI-0.6.jar or /u01/opk/OpKeyCLI-0.6.jar`)</td></tr></tbody></table>

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>Opkey Project Name</td><td>`FDOPKEY_INP_PROJECT_NAME`</td><td>Yes</td><td>Provide the Opkey project name.</td></tr><tr><td>Opkey Test Suite Path</td><td>`FDOPKEY_INP_TEST_SUITE_PATH`</td><td>Yes</td><td>Provide the Opkey test suite path. (ex: `Project Workspace\9Test\FSM Validate`)</td></tr><tr><td>Opkey Agent Name</td><td>`FDOPKEY_INP_AGENT_NAME`</td><td>Yes</td><td>Provide the agent name. (ex: `Agent1,Agent2`)</td></tr><tr><td>Opkey Plugin Name</td><td>`FDOPKEY_INP_PLUGIN_NAME`</td><td>Yes</td><td>Provide the plugin name. (ex: `OracleFusion,web,Opkey OracleEBS`)</td></tr><tr><td>Opkey Additional Arguments</td><td>`FDOPKEY_INP_ADDITIONAL_ARGUMENTS`</td><td>No</td><td>Provide any additional arguments. If you want to pass Global Variables then you can do something like`--global-variable user=FD_ADMIN`</td></tr></tbody></table>

# Outputs

<table><colgroup><col /><col /></colgroup><tbody><tr><th>**Output Name**</th><th>**Description**</th></tr><tr><td>`FDOPKEY_OUT_TEST_SUITE_STATUS`</td><td>Test suite status</td></tr><tr><td>`FDOPKEY_OUT_TEST_COUNT_RUN`</td><td>Total Test count</td></tr><tr><td>`FDOPKEY_OUT_TEST_COUNT_SUCCESS`</td><td>Total successful Test count</td></tr><tr><td>`FDOPKEY_OUT_TEST_COUNT_FAILED`</td><td>Total failure Test count</td></tr><tr><td>`FDOPKEY_OUT_TEST_COUNT_SKIPPED`</td><td>Total skiped Test count</td></tr></tbody></table>

# Artifacts

This operation doesn’t consume or produce any artifacts.

# Endpoint Selection

This operation will select all available endpoints associated to the target.

# Endpoint Execution

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 and other dynamic data for your test cases are often passed at runtime to enhance security or accommodate frequently changing values. This approach eliminates the need to modify test cases once they’ve been created. To streamline this process, Opkey provides an option to pass these values through a parameter called the **--global variable**.

Let’s look at an example of how this can be applied in FlexDeploy.

Before running the test suite, make sure you’ve created global variables in Opkey that can be mapped to your test cases. These global variables are defined within Opkey and allow you to dynamically pass values at runtime during test execution. In this example, **FSMUserName** and **FSMPassword** are global variables used to store a user’s login credentials, which can then be referenced in your test cases.

![image-20250220-110324.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12596424556.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=c1882e936e70f470b5b888c50047d4f6)

The FlexDeploy Opkey Plugin (`runOpkeyTest` operation) has a input option called `Additional Arguments`, which enables you to pass extra commands, including global variables, to the Opkey test during execution. If you are using out of box `Opkey-runOpkeyTests`, you can define the workflow input`OPKEY_INP_ADDITIONAL_ARGUMENTS` for this purpose.

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

However, when dealing with sensitive information such 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 configured. 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 prefix them with the Integration Instance account code. This ensures that credentials are securely passed during test or deployment execution without exposing sensitive information.

### Windows Example

```
---
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: true
      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.

```
---
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: true
      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

Opkey is a cloud-based test automation platform that helps organizations streamline and automate their software testing processes

## Opkey -Portal

In Opkey cloud account, go to the Home page, then navigate to Automate **>** TestSuite to access all existing test suites. Here, you can create new test suites by grouping relevant test cases and configuring them as needed. You can also trigger test executions directly from this page to generate detailed reports.

![image-20250214-073416.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12596424582.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=e93a602a0ccd06bcf9b0dc9da0e10c81)

In the screenshot above, the highlighted project name in Opkey serves as a key reference (plugin input) required for integration with FlexDeploy. This project name helps identify the test suite during execution within FlexDeploy.\
After configuring the Test Suite, right-click on the desired test suite and select View Path. This will display the path, another crucial input required by the FlexDeploy Opkey Plugin.

![image-20250214-075220.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12596424579.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=a91bf0fd0b63e805aac19063d7bc203c)

## Setting Up the Opkey Execution Agent

The next step is setting up the Opkey Execution Agent to execute tests. Download and install the agent on your Windows machine, ensuring all system requirements and dependencies like Java and .NET are met. Configure the agent properly to establish a connection with your Opkey environment, then validate the setup by running a test execution.

Note\*\*:\*\* The agent must be up and running; otherwise, you'll encounter an error stating \*\*"\*\*Agent is not online."

![image-20250214-080156.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12596424585.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=5283a80647b88aaeb599011f242a26f9)

In the Opkey Agent screenshot, the highlighted agent name is another required input when integrating with FlexDeploy. Additionally, on the right side, you can see the list of available plugins along with their validity. You will need a valid license from Opkey Support
