Forum Discussion

doubtsreadyapi's avatar
doubtsreadyapi
Contributor
5 years ago

How to combine Two post endpoints in Single request

Hi   I have two Post request  APi endpoints, I have to combine both this two endpoints in a single request, Is this possible through Ready APi? If so can some one help me,   Thanks
  • HimanshuTayal's avatar
    HimanshuTayal
    5 years ago

    doubtsreadyapi  : So, for this you can write groovy code. to match your condition, you can use below logic:

     

    fetch this condition from excel file or any other config file:

     

    condition = "add"
    if(condition == "add"){
         url == "https://addition.com"
    }
    else if(condition == "multiply"){
         url == "https://multiplication.com"
    }
    
    testRunner.testCase.getTestStepByName("Reuuest").setPropertyValue("Endpoint",url);

    Hope this will help you in resolving issue. Let me know in case you need more help.