Skip to content

Instantly share code, notes, and snippets.

@code-atom
Last active August 7, 2019 08:44
Show Gist options
  • Save code-atom/834c6627566994dce7a60132ab6abe95 to your computer and use it in GitHub Desktop.
Save code-atom/834c6627566994dce7a60132ab6abe95 to your computer and use it in GitHub Desktop.
Set Auth Profile API
import com.eviware.soapui.config.CredentialsConfig;
for(testSuiteItem in testSuite.project.getTestSuiteList()) {
for( testCaseItem in testSuiteItem.getTestCaseList()) {
for( testStep in testCaseItem.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep) ) {
log.info("Setting basic auth for all REST test requests in testStep ["+testStep.getName()+"]")
testStep.getTestRequest().setEndpoint('https://localhost');
testStep.getTestRequest().setSelectedAuthProfileAndAuthType("TEST_DM_TOKEN", com.eviware.soapui.config.CredentialsConfig.AuthType.O_AUTH_2_0);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment