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.

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    I'm moving this question to the ReadyAPI forum from the TestComplete forum.  There should be better equipped people to answer there.

  • doubtsreadyapi  : Could you please provide any more inputs:

     

    what are the endpoint

    where they are stored differently

    Any screenshot that would help in understanding your probelm.

     

      • nmrao's avatar
        nmrao
        Champion Level 3
        Provide sample data of requests and desired output.

        By the way, does the service allows that modified requests?

        What is the use case for this, haven't heard this type of question at all.