Forum Discussion

delhama's avatar
delhama
Regular Visitor
10 years ago

How to programatically provide credentials for HTTP basic authentication

We want to test web service that requires basic authentication.

It works perfectly well in the GUI but we need to do it programatically as well

 

Here is an code example from the documentation, where and how to set the username and password

 

WsdlProjectPro project = new WsdlProjectPro("MyProject-soapui-project.xml");
List<TestSuite> testSuites = project.getTestSuiteList();
for( TestSuite suite : testSuites ) {
    List<TestCase> testCases = suite.getTestCaseList();
    for( TestCase testCase : testCases ) {
        PropertiesMap map = new PropertiesMap();
        TestRunner runner = testCase.run(map, false);
        assertEquals(Status.FINISHED, runner.getStatus());
    }
}

 

No RepliesBe the first to reply