If you're reading this post you probably have come across this error when using testrunner.sh...
That error is simply due to SoapUI not authenticating to WebLogic (or another container) when sending a SOAP request. It's easily fixed, at least in the UI. However, when testing it is a good idea to be able to control what username and credentials are used for authentication, after all you may want to try different combinations of users and credentials that may have varying access rights, etc.
I found this article that talks about how to achieve this effect at the test suite level, but didn't like the implementation since it didn't use project properties to set the HTTP auth.
My version takes a slightly different approach, similar to what I described in my previously article on using SoapUI with project properties. I add a Setup Script to the Test Case. In addition I do a little bit more validation to ensure authentication happens or the test case fails if login details are not provided. For my testing, I only had one test case that was ran multiple times so this approach worked well. The script below can be easily updated to work with a suite if so required.
So first of all you need to open the Test Case Editor and click the Setup Script tab, that's where you add the code for the script.
This is the script I used...
What the above script does is look for two project properties, httpUser and httpPasswd, makes sure they aren't null and then creates a HTTP Authorization header using those two properties.
Now to set those properties you pass them using the -P parameters to the testrunner.sh script like so:
Not showing all the other options that are required for testrunner.sh for brevity.
So that's all there is to it. If you have multiple test cases that require authentication, copy/paste the above script into each of them, but at that point you probably should consider using a test suite setup script instead.