Forum Discussion

Syamaprasad's avatar
Syamaprasad
New Contributor
8 years ago

Executing Ready API composite project via maven

I am trying to integrate maven with ready api project. I have imported the project as composite project in Ready API 1.9.0.

So on trying to run the settings.xml with the given test suite, it is showing

 

[ERROR] java.lang.Exception: A test suite with the name [E2E_HZN3_UseCases] is missing in the project [E2E_HZN3_SoapUI_Automation]

 

I have tried to use the maven soapui pro version, but it was not successful.

 

Could you please help me in executing maven as composite project/How can I convert the current composite project to normal project.

 

Please see the pom.xml

 

<properties>
        <readyapi.version>1.9.0</readyapi.version>
        <soapui.home>C:\Program Files\SmartBear\ReadyAPI-1.9.0\bin\</soapui.home>
        <project.basedir>D:\HZN_E2E_SI_Git\E2E_HZN3-SoapUI-Automation\</project.basedir>
    </properties>

    <pluginRepositories>
      <pluginRepository>
         <id>SmartBearPluginRepository</id>
         <url>http://smartbearsoftware.com/repository/maven2</url>
      </pluginRepository>
   </pluginRepositories>
    
    <build>
        <plugins>        
             <plugin>

            <!--Plugin groupID used to uniquely identify the project with the plugin.-->
            <groupId>com.smartbear</groupId>
            <!--Plugin artifactId used to find the plugin in the project.-->
            <artifactId>ready-api-maven-plugin</artifactId>
            <!--<artifactId>soapui-pro-maven-plugin</artifactId>-->
            <!--Specifies your Ready! API version. Maven will use the appropriate plugin version.-->
            <!-- IMPORTANT: Must be the same as your Ready! API version.-->
            <version>1.9.0</version>
            <!--<version>5.1.2-m-SNAPSHOT</version>-->

            <executions>
               <execution>

                  <!--Specifies the lifecycle phase to run Ready! API tests .-->
                  <!--We recommend using the test phase.-->
                  <phase>test</phase>
                  <goals>
                     <!--Do not change. Commands Maven plugin to run a functional test.-->
                     <goal>test</goal>
                  </goals>

                  <configuration>

                     <!--Required. Specifies the path to the project to execute.-->
                     <!--<projectFile>settings.xml</projectFile>.-->
                     <projectFile>settings.xml</projectFile>
                     <!--Required for reports. Specifies the format of the report to generate.-->
                     <!--Possible values: PDF, XLS, HTML, RTF, CSV, TXT and XML. Only available in Ready! API Pro. -->                      <reportFormat>PDF</reportFormat>
                     <!--Required for Maven Surefire reports. Must be true. -->
                     <!--Commands Ready! API to generate JUnit-style reports.-->
                     <junitReport>true</junitReport>
                     <!--Required for Maven Surefire reports. Must be as shown. -->
                     <!--Specifies the folder to store reports in. -->
                     <reports>${basedir}/target/surefire-reports</reports>

                     <!-- ========= Additional elements ============= -->

                     <!--Specifies the name of the test suite to run.-->
                     <testSuite>E2E_HZN3_UseCases</testSuite>

                     <!--Provides access to Ready! API properties.-->
                     <readyApiProperties>
                        <property>
                            <name>soapui.home</name>
                            <value>C:/Program Files/SmartBear/ReadyAPI-1.9.0/bin</value>
                        </property>
                    </readyApiProperties>
                     <!--If true, Ready! API will not send usage statistics.-->
                     <!--optOutUsageStatistics></optOutUsageStatistics-->

                     <!-- ========= /Additional elements ============= -->

                  </configuration>
               </execution>
            </executions>
         </plugin>

         <!--Add Maven Site Plugin to improve test stability and prepare test data for Maven SureFire.-->
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.5</version>
         </plugin>
            
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>
        </plugins>
    </reporting>

8 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Syamaprasad,

     

     

    As you are using a composite project, you need to specify the catalog of your project in your POM (the catalog where settings.xml is located):

    <projectFile>PATH TO YOUR CATALOG</projectFile>

     

     

    • Syamaprasad's avatar
      Syamaprasad
      New Contributor

      Thanks Tanya for the inputs. I have tried giving the absolute path of the settings.xml eariler also like this

       

      <projectFile>D:\HZN_E2E_SI_Git\E2E_HZN3-SoapUI-Automation\E2E_HZN3-SoapUI-Automation-project\settings.xml</projectFile>

       

      On executing, it is identifying that the E2E_HZN3-SoapUI-Automation project, but it doesn't get the testsuite inside the settings.xml. Please see the console output

       

      13:50:00,159 INFO  [SoapUIProTestCaseRunner] Running tests in the project [E2E_HZN3_SoapUI_Automation]
      [ERROR] java.lang.Exception: A test suite with the name [E2E_HZN3_UseCases] is missing in the project [E2E_HZN3_SoapUI_Automation]
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 16.850 s
      [INFO] Finished at: 2017-02-02T13:50:00+05:30
      [INFO] Final Memory: 41M/354M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal com.smartbear:ready-api-maven-plugin:1.9.0:test (default) on project E2E_HZN3-SoapUI-Automation-project: Ready! API Test(s) failed: Ready! API Test(s) failed:
      [ERROR] A test suite with the name [E2E_HZN3_UseCases] is missing in the project [E2E_HZN3_SoapUI_Automation]

       

      But on trying to import as composite project in Ready API, it is importing all the testsuites in Ready API.

       

       

      Also I am able to execute the testcases in the testsuite on running testrunner.bat

      %soapUIHome%\testrunner.bat -sE2E_HZN3_UseCases(This will execute the testcases in the test suite)

       

      Only on executing as maven project, it is not getting the testsuites inside the project.

      One Doubt I have is that the testsuites are inside E2E_HZN3-SoapUI-Automation-project in E2E_HZN3-SoapUI-Automation folder. But on importing as composite project, we are giving the path till E2E_HZN3-SoapUI-Automation folder only. How they are taking the testsuites and settings.xml inside E2E_HZN3-SoapUI-Automation-project folder

       

      Please correct if we are wrong anywhere

      • redfish4ktc2's avatar
        redfish4ktc2
        Super Contributor

        Hello Syamaprasad

        Did you try to run it with the following configuration (no settings.xml in the projectFile property, only the directory path)

        <projectFile>D:\HZN_E2E_SI_Git\E2E_HZN3-SoapUI-Automation\E2E_HZN3-SoapUI-Automation-project</projectFile>