Forum Discussion

Holly_Greger's avatar
Holly_Greger
Contributor
15 years ago

launching fitnesse from SoapUI

Hello,

Is there any way to launch a fitness test from SoapUI? Maybe a groovy test step can handle the calling and results interpretation. Any way these two can communicate?

Thanks,

3 Replies

  • Hello,

    It's probably possible, but I don't have much knowledge about how FitNesse works. After a quick glance at the user guide, it seems FitNesse can run as a Web Server, allowing tests to be run by querying a Rest Service. It sounds like the easiest thing to do is simply create a RestService in soapUI and add requests to run your tests, and then add assertions to the response which contains the result of the FitNesse tests.

    Regards,
    Dain
    eviware.com
  • I got it working. I actually took advantage of what the fitnesse TestRunner can do. In groovy one can call .execute() on a string and any command in that string will be execute against the shell so i fired off FitNesse tests like this.

    def process = "cmd /c java -jar fitnesse.jar -c \"MyTestPage?test&format=text\"".execute()

    this process is the groovy implementation of a java process, API found here, http://groovy.codehaus.org/groovy-jdk/java/lang/Process.html

    so to my purpose i used the waitForProcessOutput method to get the output in a stream after the process finishes.

    ByteArrayOutputStream outStream = new ByteArrayOutputStream()
    process.waitForProcessOutput(outStream, new ByteArrayOutputStream())


    now this outStream contains the entire console ouput from the command execution so you can parse it at will. For example this line will print every line in the stream to your log.

    outStream.toString().eachLine{line -> log.info line }


    Hope this helps someone out there trying to get something similar done. Thank you for your suggestion.