Extending HCL OneTest™ API functionality by using custom functions
You can add more calculations and operations to tests by using the HCL OneTest™ API custom function class. HCL OneTest™ API custom function is a Java™ class that extends the com.ghc.ghTester.expressions
function.
Note: All custom functions can be called from any of the supported scripting languages in HCL OneTest™ API.
The following steps provide an overview of how to develop a function for use in HCL OneTest™ API:
- Create a plug-in, which is a Java™ code wrapper that allows the plug-in to be loaded into HCL OneTest™ API. Using the Eclipse IDE for Java™ EE is the easiest way to create a plug-in, but you can also create a plug-in from a different IDE.
- Develop your function class, which involves creating a Java™ class and implementing the function behavior. If you have an existing function and want to modify it to work with HCL OneTest™ API, you must convert existing function classes with Eclipse.
- Create a function extension to provide HCL OneTest™ API with details about your function, such as its name and the class that implements the function.
- Configure and use the function in HCL OneTest™ API, which lets HCL OneTest™ API load your function to be used inside your HCL OneTest™ API project.