I first wanted to just state that as great of a tool as SoapUI is, their community support just plain sucks! Any time I navigate to their discussion fora, I can actually hear the crickets in the distance. If you need some help, may I recommend the Service Testing using soapUI (needs login) group at LinkedIn.
Now back to your regular programming …
the quick and dirty
So the most obvious, and perhaps the easiest way, to get Selenium and SoapUI to cooperate is:
- Install SoapUI.
- Download Selenium (you need the selenium-server-standalone-2.*.jar) and drop it into your SoapUI installation (into %SOAPUI_HOME%\bin\ext).
- Fire up SoapUI; start a new Project; create a new test case; add a new Groovy step; copy-paste the sample code into the step. I made a few modification: drop the
packageline, drop the
void mainlines along with the closing brackets, and change the
log.info. My final (full) test code is below.
- Click Play. You should see Firefox starting up, navigating to Google, and afterwards you should see the SoapUI log entries.
Success, the two can talk to each other. You will probably notice some errors, due to Google updating their site and the above code no longer works there; however, the proof of concept is there. For a better example, see my sample code.
the difficult way
I did not get as much chance to play with the SoapUI as I would have liked, but I wanted to get this published. The above will work for simple Selenium steps. However, for more complex steps you probably want a little more.
Unfortunately, I have not had a chance to explore this yet, but the general idea is:
- SoapUI is a java project, it must be in some .jars somewhere, hopefully in just one.
- Import that into your Groovy (Java) project.
- Then you should be able to call appropriate functions from your code.
All this sounds quite easy, but I am certain that it will need more than what I have here. If anyone manages to get this to work, I would be really curious to hear from you.