Thomas Sundberg

November 16, 2011

Testing a Web Service with SoapUI, JUnit, Maven and Cucumber

This post is available at http://www.thinkcode.se/blog/2011/11/16/testing-a-web-service-with-soapui-junit-maven-and-cucumber

22 Comments »

  1. You have not posted the root pom.xml file.

    Comment by Lanoxx — December 13, 2012 @ 12:24

    • No, I seem to have missed it.

      The root pom is an aggregation pom that contains the two modules product and test, some common properties and a common dependency like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <project>
          <modelVersion>4.0.0</modelVersion>
          <groupId>se.sigma.cucumber</groupId>
          <artifactId>example</artifactId>
          <version>1.0-SNAPSHOT</version>
          <packaging>pom</packaging>
          <modules>
              <module>product</module>
              <module>test</module>
          </modules>
          <properties>
              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
              <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
          </properties>
          <dependencies>
              <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>4.10</version>
                  <scope>test</scope>
              </dependency>
          </dependencies>
      </project>
      

      Comment by Thomas Sundberg — December 14, 2012 @ 07:02

  2. Instead of Junit, I just want to run soapui tests from ruby code, almost equal to cucumber(Features)-ruby(Step definitions in ruby)-soapui(to run soap tests), but I didn’t find any ruby support to kickoff soapui tests like SoapUITestCaseRunner.

    Comment by Ram — January 4, 2013 @ 00:16

    • I mean to say I just want to have support file in ruby instead of java

      Comment by Ram — January 4, 2013 @ 00:17

      • I am sorry, I haven’t tried to use that combination. I would ask the guys at Smartbear, who is developing SopaUI, if they have any pointers.

        HTH
        Thomas

        Comment by Thomas Sundberg — January 4, 2013 @ 06:20

  3. Wonderful post !! really helped me, Thanks.

    Comment by Sunil — January 4, 2013 @ 08:30

  4. […] Testing a Web Service with SoapUI, JUnit, Maven and Cucumber | Thomas Sundberg – March 19th ( tags: soapUI junit maven cucumber testing howto example tutorial guide example test webservices ) […]

    Pingback by Delicious Bookmarks for March 19th from 15:03 to 22:00 « Lâmôlabs — March 20, 2013 @ 03:01

  5. Thanks for nice post. Could you please elaborate SoapUITestCaseRunner class and its definition. how it is being used in cucumber then steps.

    Comment by Samiran Roy — September 11, 2014 @ 09:23

    • Hi!

      What is it that you would like to know about SoapUITestCaseRunner? It is a way to execute a SoapUI project. What is it above that you need more information about? What didn’t work when you tried to use it?

      /Thomas

      Comment by Thomas Sundberg — September 11, 2014 @ 20:42

  6. […] Testing a Web Service with SoapUI, JUnit, Maven and Cucumber – 16/11/2011 · Instead of Junit, I just want to run soapui tests from ruby code, almost equal to cucumber(Features)-ruby(Step definitions in ruby)-soapui(to run soap …… […]

    Pingback by Web Application Testing Junit | Technology Documents — January 12, 2015 @ 16:17

  7. Man this post is awesome..

    Comment by Ahmet Yalçınkaya — August 25, 2015 @ 15:12

  8. Great article (nothing new, I guess)
    Clarification, please:
    It seems that the final pom.xml has a duplicate dependency:

    info.cukes
    cucumber-junit
    1.0.1

    Is this on purpose? If so, explain…

    Thanks

    Comment by Bey Melamed — December 12, 2015 @ 21:34

    • Hi!

      I don’t see the duplicated dependency you mention. I only see cucumber-java and cucumber-junit, which both are needed.

      Should there have been a duplicated dependency entry, it would probably have been a mistake.

      Cheers,
      Thomas

      Comment by Thomas Sundberg — December 13, 2015 @ 11:29

      • You are right – I got the tooth-pick out of my eye then figured it out shortly after hitting the send button 😦
        However, if I may engage you for one more exchange…
        I find the project structure a bit unusual with 3 pom.xml … or am I imagining again…
        Could you please explain this point
        Are these pom.xml the same?

        Comment by Bey Melamed — December 15, 2015 @ 04:12

  9. Hi!

    The idea I had was that I wanted to separate the production code from the SoapUI tests. And I did that with two different Maven modules. Each module has its own pom.xml. And with two modules that has a dependency between them, I wanted a parent pom to keep them together. Therefore three poms as shown in the file structure section.

    My reasoning behind this separation was that the SoapUI stuff is more of an integration test than anything else. I like having integration tests a bit further away from the production code so I can have fast unit tests close to the production code. I want to run the unit tests very frequent. I don’t want to run the slow integration tests by accident.

    /Thomas

    Comment by Thomas Sundberg — December 15, 2015 @ 06:22

    • Thanks for taking the time – I did notice the motivation behind it in the article but, being a newbie to the topic (and less than Maven maven) I got confused by the concept and implementation.
      Is there any way to get this (or similar) project as a downloadable from github (or elsewhere?)

      Comment by Bey Melamed — December 15, 2015 @ 18:34

      • Hi!

        All source code is available in the blog post. If you want to re-create the example, create the files needed and paste the source. I don’t have any GitHub repo where the source is available.

        /Thomas

        Comment by Thomas Sundberg — December 15, 2015 @ 22:49

  10. Hi, any chance this can be updated to work with soapui 5.2.1 – I have tried but i can’t seem to get it working. All tests i create in soapui (5.2.1) no longer work in the above example as its using an older soapui and the authentication methods have since changed.

    Could you please help get this working for the latest soap client?

    Comment by techno — March 22, 2016 @ 09:46

    • Hi!

      I will not update this blog post to use a modern version of SoapUI. It is what it is.

      I could of course write a new post with a modern SoapUI version. If you are interested in that, please contact me. I would have to invoice the work.

      Cheers,
      Thomas

      Comment by Thomas Sundberg — March 22, 2016 @ 22:01

  11. Hi I am trying to integrate SoapUI with Specflow, Nunit. IS that possible ?

    Comment by kruthi — November 1, 2016 @ 20:22

    • Hi!

      I would expect it to be possible. I know at least one approach I would use in the Java world. I am not sure how I would do it in the .net world.

      My approach would probably be to start an external process from Specflow and then monitor its result.

      How would you do it from any .net program, not specifically Specflow? This is the solution I would pursue.

      /Thomas

      Comment by Thomas Sundberg — November 1, 2016 @ 21:53


RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.