Forum Discussion

mahima's avatar
mahima
New Contributor
7 years ago

How to set authorization header in SoapUIProTestCaseRunner?

While integrating ReadyAPI tests with Java code, how to set authorization? I get error:

#status# : HTTP/1.1 403 Forbidden in java console
SoapUIProTestCaseRunner runner = new SoapUIProTestCaseRunner();runner.setProjectFile("C://APILOcal//activations.xml");runner.setTestSuite("ServiceSOAP TestSuite");runner.setTestCase("createContractBundle TestCase");runner.setTestStepCount(3);
//runner.setGlobalProperties(new String[]{"Authorization: Basic admin=admin"});
//runner.setCustomHeaders(new String[]{"Authorization: Basic admin=admin"});
//runner.setUsername("admin");
//runner.setPassword("admin");
//runner.setWssPasswordType("PasswordText");runner.run();

I have set username and password in readyAPI Tool and can successfully run the test in the tool.

Please guide.