Sunday, June 16, 2013

SOAP UI : SetUp HTTP Basic Authentication for soapUI Test Suties


SetUp HTTP Basic Authentication for soapUI Test Suties

import com.eviware.soapui.impl.wsdl.teststeps.*
for( testCase in testSuite.getTestCaseList() )
{
log.info("Setting HTTP basic auth for all WSDL test requests in test case ["+ testCase.getLabel()+"]")
for( testStep in testCase.getTestStepList() )
{
if( testStep instanceof WsdlTestRequestStep )
{
//Create UNAME variable in tesSuite testProperties and assign Value to it.
testStep.getTestRequest() .setUsername(testSuite .getPropertyValue("UNAME"))
//Create PASSWORD variable in tesSuite testProperties and assign Value to it.
testStep.getTestRequest() .setPassword(testSuite .getPropertyValue("PASSWORD"))
}
}
}

No comments:

Post a Comment