🏗️API Tailor-Made coding

Overview

Tailor-Made coding is a significant feature in scriptless automation that empowers users to write custom code for specific requirements. This feature seamlessly integrates user-defined algorithms into the automation workflow, enabling full customization of the test execution process.

Implementing Tailor-Made Coding

To leverage custom code in their automation, users should place their code within the Maven project structure, specifically under the src directory.

Usage in CSV Template

Tailor-Made coding can be applied to various parameters within the CSV template, such as PARAMS:VALUE, AUTH:VALUE, HEADERS:VALUE, and BODY:VALUE. The syntax to invoke custom code is:

Custom:ClassName:MethodName
  • Custom: This keyword signifies that custom code will be used.

  • ClassName: The name of the class containing the custom method.

  • MethodName: The name of the method to be executed.

CSV Template Example

DEPENDANT_TEST_CASE,NONE,
END_POINT,https://api-generator.retool.com/7kbSLy/data,
METHOD,POST,
PARAMS:KEY,NONE,
PARAMS:VALUE,NONE,
AUTH:KEY,NONE,
AUTH:VALUE,NONE,
HEADERS:KEY,Content-Type,
HEADERS:VALUE,application/json,
BODY:KEY,JsonRepository,name
BODY:VALUE,test,Custom:CustomClass:body
RESPONSE:CODE,201,
RESPONSE:JSON_PATH,'Column 1',id
RESPONSE:EXPECTED_VALUE,PrecisionTestAutomation1,NONE
RESPONSE:STORE_VALUE,NONE,ID

In this example, Custom:CustomClass:body indicates that the body method from CustomClass will be called.

Java Class Example

public class CustomClass {

    public String body() {
        // Custom logic or algorithm
        return "PrecisionTestAutomation1";
    }
}

Benefits of Tailor-Made Coding

  • Customization: Provides the flexibility to implement custom logic that cannot be achieved through standard automation steps.

  • Enhanced Capability: Offers the ability to execute complex algorithms or calculations as part of the automation.

  • Integration: Allows custom code to be directly integrated with standard automation parameters, enhancing the overall functionality.

Conclusion

The Tailor-Made coding feature extends the capabilities of scriptless automation by allowing the execution of custom code. This feature fulfills the need for bespoke automation steps, ensuring that the automation can accommodate any special requirements or logic necessary for the testing process. It represents a powerful tool in the scriptless automation arsenal, delivering a truly customisable and comprehensive automation experience.

Last updated

Was this helpful?