Any thought on how to set Authentication type to Basic over the run programmatically
I have a following code to create to create Basic profile for specific test step,
def testStep= testRunner.getTestCase().getTestStepByName("RunTimeOperation")
testStep.getTestRequest().addBasicAuthenticationProfile("Basic")
testStep.getTestRequest().setUsername(strUserName)
testStep.getTestRequest().setPassword(strPwd)
testStep.getTestRequest().setDomain(strDomain)
testStep.getTestRequest().setPreemptive(true)
However request sent to server with Authorization - No Authorization. any thoughts on how to select the Authorization : Basic using groovy?
You need to select the authentication profile. The following code should do the job:
testStep.getTestRequest().setSelectedAuthProfileAndAuthType('Basic', AuthType.PREEMPTIVE)
For other types of authetication see the API docs:
https://www.soapui.org/apidocs/com/eviware/soapui/config/CredentialsConfig.AuthType.html
Thank you for the response. and i have resolved the issue by adding the following code.
testStep.getTestRequest().setSelectedAuthProfileAndAuthType(AbstractHttpRequest.BASIC_AUTH_PROFILE,CredentialsConfig.AuthType.PREEMPTIVE)
and it is the same as you mentioned above.