How To Railroad Train Ascendancy Header Inwards All Soapui Exam Cases Via Script

To gear upwards the Authorization header inwards each exam representative of a testSuite, nosotros operate the script below.

import com.eviware.soapui.impl.wsdl.teststeps.* import com.eviware.soapui.support.types.*;  StringToStringMap headers = novel StringToStringMap(); StringToStringMap headersForSuper = novel StringToStringMap();   String userPass = testCase.testSuite.project.getPropertyValue("username")+":"+testCase.testSuite.project.getPropertyValue("password"); log.info("userPass=" + userPass);  headers.put("Authorization","Basic "+userPass.getBytes().encodeBase64());  for(testSuiteItem inwards  testCase.testSuite.project.getTestSuiteList()){  for( testCaseItem inwards testSuiteItem.getTestCaseList() ) {      log.info("Setting basic auth for all WSDL exam requests inwards exam representative ["+testCaseItem.getName()+"]")      for( testStep inwards testCaseItem.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep) ) {    testStep.getTestRequest().setPreemptive(true);           testStep.getTestRequest().setRequestHeaders(headers);      }  } } 
Next
Previous
Click here for Comments

0 komentar:

Please comment if there are any that need to be asked.