# 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.precisiontestautomation.in/scriptlessautomation/automation-platforms/scriptlessapi-automation/api-tailor-made-coding.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
