Hi,
My question is we need to write the script for Multiple end points change at a time i have wrote like this but unfortunately not able to please check my below code
def result = com.eviware.soapui.support.UISupport.prompt("Please select the enviornment", "Environment", ['shr-rbdevkong(Kong QA server*)','shr-rbqakong(Kong QA Server Alert*)','hc-kong-qa(Kong QA Server Old*)'])
def Server =['shr-rbdevkong(Kong QA server*)' ,'shr-rbqakong(Kong QA Server Alert*)' ,'hc-kong-qa(Kong QA Server Old*)']
/*def Endpoints=[""]
def Authorizationlist=[""]*/
if (result.toString().equals(Server[0])) {EndPoints = EndPointList[0]; Authorizationlist = "No Authorization";
log.info"0"}
log.info "Authvalue" + Authorizationlist
if (result.toString().equals(Server[1])) {EndPoints = EndPointList[1]; Authorizationlist = "No Authorization";
log.info"1"}
log.info "Authvalue" + Authorizationlist
if (result.toString().equals(Server[2])) {EndPoints = EndPointList[2]; Authorizationlist = "No Authorization";
log.info"2"}
log.info "Authvalue" + Authorizationlist
//for all testsuites
def testSuites = testSuite.project.getTestSuiteList()
testSuites.each { testSuite ->
log.info "TestSuite name:::"+testSuite.getName()
def testcases = testSuite.getTestCaseList()
log.info "Test Cases under the test suite ::::"+testSuite.getName()
testcases.each { testCase ->
log.info "TestCase name:::"+testCase.getName()
log.info "Test Steps under the test Case ::::"+testCase.getName()
def teststeps = testCase.getTestStepList()
teststeps.each { testStep ->
log.info "TestStep name:::"+testStep.getName()
def teststeps = testcase.getTestStepList()
teststeps.each { teststep ->
teststep.setPropertyValue('endpoint','EndPoint')
if {teststep.config.type =="restrequest"} {
def httpRequest =teststep.getHttpRequest()
httpRequest.setPreemptive(true);
httpRequest.setselectdAuthProfileandAuthType(Authorizationlist,com.eviware.soapui.config.CredentialsConfig.AuthType.PREEMPTIVE);
}
}
}