user3282910
user3282910

Reputation: 1

Set endpoint for Soap UI in groovy script

I need to add a new endpoint from groovy script to the testcase request in soapUI. Here I used rest project, my code is as follows:

def end= testRunner.testCase.getTestStepByName("dd").getHttpRequest().setEndpoint("http://cd-diudara:8280/services/linkedinFollowCompanyPage?wsdl")

This is getting me null in the "end" variable. What is wrong with this code?

Upvotes: 0

Views: 5889

Answers (1)

albciff
albciff

Reputation: 18507

Your code work as expected, if you open your testStep after groovy script execution, on the endpoint bar you will see your new endpoint. However setEndpoint(endpoint) method doesn't return nothing, this is the reason why you have a null in the "end" variable.

If you want to get the endpoint you can invoke getEndpoint():

testRunner.testCase.getTestStepByName("dd").getHttpRequest().setEndpoint("http://cd-diudara:8280/services/linkedinFollowCompanyPage?wsdl");
def end = testRunner.testCase.getTestStepByName("dd").getHttpRequest().getEndpoint();
log.info end;

Upvotes: 3

Related Questions