Integrating Eggplant AI with Third-Party Tools
You might need Eggplant AI to provide test run information to a third-party tool. For example, if you use HP ALM or Jira, you're probably familiar with results reporting through those interfaces. Eggplant AI can send information to third-party tools following the completion of a test run.
Setting Up Third-Party Integration
To provide third-party tool integration, you can configure Eggplant AI to run an executable at the completion of a test run. You need an executable file (e.g., .bat, .exe) that sends the appropriate information to your chosen tool.
There are specific things you need to do to configure a third-party script to execute following an Eggplant AI test run:
- The executable file must be located on the same machine as Eggplant AI.
The executable file name must be eggplantAIpostExecHook but can be any executable file type recognized by the local Windows system. For example, you might commonly use .exe or .bat files.
- The executable file must be discoverable considering the %PATH% system variable. For example, if you type eggplantAIpostExecHook.bat in a command prompt, it should execute.
Configuring Third-Party Integration
The following instructions show how to configure Eggplant AI to run an executable file after an Eggplant AI test:
- Create a folder on the Eggplant AI server. For this example, the folder is C:\AIScript.
- Edit the Path system environment variable and add the new folder to it (for example, C:\AIScript).
- Copy the file you want Eggplant AI to execute to that folder. For example, you might rename a compiled executable to eggplantAIpostExecHook.exe and add it to that folder.
Add the following program lines to the end of the file you want executed at the end of the test run:
) > "C:\AIScript\hasrun.txt"Note: The path in the last line of the code specifies the output folder that Eggplant AI uses. If you want to use a different folder for output than where you've placed the executable, you can change the path in the code above to any valid (existing) folder.
- Run a test in Eggplant AI.
At the completion of the test run, the eggplantAIpostExecHook.exe file executes and passes the following set of parameters into a file called hasrun.txt, which is located in the output folder specified in the script. For the example above, you would look for the hasrun.txt file in the C:\AIScript folder. The file contains the following parameters:
- Run ID: The identifier for the test that you ran.
- Model name: The name of the Eggplant AI model.
- Group name: The Eggplant AI model's group name.
- Is directed: This parameter is true if the test that you ran was a Directed Test Case.
To work with this integration feature, start with a simple executable file, then add complexity as you become more familiar with this feature.