Forum Discussion

sujatha1's avatar
sujatha1
Occasional Contributor
11 years ago

maven-soapui-pro-plugin

I am unable to test single testSuite .even i have specified testSuite name still not working.please help me.

10 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Would you mind providing more information as possible, like how are you using, what is the issue being faced, which help to assist
  • sujatha1's avatar
    sujatha1
    Occasional Contributor
    I have tried to run single testsuite But it is not working

    This is my pom file:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.suj</groupId>
    <artifactId>com-company-foo</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>soapui-maven2-plugin</name>
    <url>http://maven.apache.org</url>
    <build>
    <plugins>
    <plugin>
    <groupId>eviware</groupId>
    <artifactId>maven-soapui-pro-plugin</artifactId>
    <version>4.5.1</version>
    <executions>
    <execution>
    <id>soap</id>
    <phase>test</phase>
    <goals>
    <goal>test</goal>
    </goals>
    <configuration>
    <projectFile>${artifactId}-soapui-project.xml</projectFile>
    <testSuite>${testSuite}</testSuite>
    <outputFolder>MavenSoap</outputFolder>
    </configuration>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>
    <pluginRepositories>
    <pluginRepository>
    <id>eviwarePluginRepository</id>
    <url>http://www.soapui.org/repository/maven2/eviware/maven-soapui-pro-plugin</url>
    </pluginRepository>
    </pluginRepositories>
    </project>

    and from command prompt:

    mvn eviware:maven-soapui-pro-plugin:test -DtestSuite="testsuitename"

    still all the testsuites are running
  • nmrao's avatar
    nmrao
    Champion Level 3
    Please see this post
    viewtopic.php?f=3&t=8701

    extract from above link, you seemed to mention testSuite instead of testSuiteName.

    <properties>
    <testSuiteName>Test Suite 1</testSuiteName>
    </properties>

    - you can specify test suite on command line, eg.

    mvn eviware:maven-soapui-plugin:test -DtestSuiteName="some test suite name"
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    nmrao the testSuite parameter is right (see the end of the post you have provided and the plugin documentation )

    The problem comes from the plugin configuration. The configuration is only set for the defined execution binded to the test phase. Give a try to mvn clean test -DtestSuite="my-failing-test-suite" (this will fail as the providing testsuite name does not exist, but you will now be sure the parameter is used)
    If you want to use the plugin outside of a maven phase, put the configuration outside of the execution definition


    I have also some remarks about the pom
    - the url of the plugin repository is wrong: it should be http://www.soapui.org/repository/maven2
    - you can remove the <testSuite>${testSuite}</testSuite> from the pom. This is undocumented but you have a way to override plugin properties directly from the command line. For the testSuite parameter, use -Dsoapui.testsuite="my-failing-test-suite". Usually, you can use -Dsoapui.<property_name> but sometimes the case is no the same (as for testSuite) or sometimes a completly different value (as for settingsPassword with -Dsoapui.settingfFile.password). You can find all values in the META-INF/maven/plugin.xml in the jar of the maven plugin
  • sujatha1's avatar
    sujatha1
    Occasional Contributor
    thanks alot its working but all my xpath assertions are failing
  • nmrao's avatar
    nmrao
    Champion Level 3
    redfish4ktc2 thank you for directing correctly. I am really no voice at maven, may be i should have been silent when unsure.
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    nmrao no problem, the post you provided was confusing, and setting parameter when using the command line is not really documented

    sujatha1 "all my xpath assertions are failing" --> are these assertions ok when you run your project from the SoapUI application?
  • sujatha1's avatar
    sujatha1
    Occasional Contributor
    I have added junit dependency then it worked fine.
  • redfish4ktc2's avatar
    redfish4ktc2
    Super Contributor
    sujatha1 for my information, you mean that you added a junit dependency to the soapui plugin declaration, then the xpath assertions worked when running maven?