API Automation with Test Project

Dear Team, I love this tool which makes us easy to automate almost everything on web/mobile.
We are currently using Rest Assured for API Automation which needs good technical skills to achieve swift API Automation.
I am trying to use TP for API Automation. I could validate the request response with RestFul Api Automation.

But I could not create standalone API Tests. I need to write against web/mobile platform.

Is it possible to execute simple api tests as in Postman or Rest Assured?

Many thanks for help!

Hi @rahool,
Here are two options that can fit your case:

  1. Create a test with all of your API requests, using a website such as ‘google.com’ as your application.

  2. Creating a generic coded test and uploading it back to TestProject.
    I have attached a code example that will fit your case:

package io.testproject.generated.tests.ransproject;

import io.testproject.sdk.drivers.GenericDriver;
import io.testproject.sdk.drivers.ReportingDriver;
import io.testproject.sdk.interfaces.junit5.ExceptionsReporter;

import java.lang.Exception;
import java.lang.Override;
import java.lang.String;
import java.net.HttpURLConnection;
import java.net.URL;

import org.junit.jupiter.api.*;

@DisplayName("Generic Test")
public class Sample implements ExceptionsReporter {
    public static GenericDriver driver;

    static void setup() throws Exception {
        driver = new GenericDriver("Project Name", "Job Name");

    void execute() throws Exception {
        // set timeout for driver actions (similar to step timeout)
        URL url = new URL("http://example.testproject.io");
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestProperty("Content-Type", "application/json");
        String status = String.valueOf(con.getResponseCode());
        getDriver().report().step("calculation result", "Server status for http://example.testproject.io is: " + status, true, false);
        Assertions.assertEquals("200", status);

    public ReportingDriver getDriver() {
        return (ReportingDriver) driver;

    static void tearDown() {
        if (driver != null) {

*You will need to add your TP_DEV_TOKEN to your computer account’s Environment Variables.

If it is your first time creating a coded test, you can read these articles:

How to create jar file from java project with TestProject sdk and upload it as a coded test

How can i upload a coded test to TestProject

Thanks Ran,

May be we can avoid launching browser with web URL in option 1. It works like a charm but we do not need to launch browser to execute the API cases.

Hi @rahool,
Accessing GenericDriver is only available when using a coded test.
If you are using a recorded you can use a simple application as mentioned above.

thanks again @ran.ferdinaro ,
Power of Test Project is its capability of automation with very little coding experience.
i am really impressed with its record and play functionality, maybe this improvement can be addressed easily.
I would like to see TP is running API Automation without any UI client interaction.


This topic was automatically closed after 180 days. New replies are no longer allowed.