cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to set endpoint separately for two REST request steps

SOLVED
Highlighted
Visitor

Unable to set endpoint separately for two REST request steps

I have a need of setting different endpoints for two REST steps of a test case. 

 

I am using below groovy in setup script of Test case: 

 

testRunner.testCase.getTestStepByName("http_request_200").getTestRequest().setEndpoint("https://secondendpoint/v2")
}

 

Issue: This is setting up "https://firstendpoint/v2" endpoint for entire service profile and hence all other requests will run with this. 

 

Requirement: "https://secondendpoint/v2"  should be set only for "http_request_200" and all other requests should run with default endpoint ( "https://secondendpoint/v2" )  which is set for the service in Environments window. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

Re: Unable to set endpoint separately for two REST request steps

@abhi_057 :

 

You can use below command to set Endpoint for particular step:

 

testRunner.testCase.getTestStepByName("SOAP Request").setPropertyValue("Endpoint","testing")

Hope it will help you in resolving your error. 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

1 REPLY 1
Highlighted
Community Leader

Re: Unable to set endpoint separately for two REST request steps

@abhi_057 :

 

You can use below command to set Endpoint for particular step:

 

testRunner.testCase.getTestStepByName("SOAP Request").setPropertyValue("Endpoint","testing")

Hope it will help you in resolving your error. 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors