0

Not able to read composite project file from java getting an error as "Unexpected element: CDATA".

WsdlTestCase testCase = new WsdlProject("src/test/resources/xml/SoapUI")
                            .getTestSuiteByName("TestSuite 1")
                            .getTestCaseByName("TestCase 1");

I also tried to use WsdlProjectPro but getting error as

"java.lang.NoClassDefFoundError: com/eviware/soapui/impl/wsdl/WsdlProjectPro"

.

Please Note: I have added all the Jar in ReadyAPI_HOME/bin/ and READYAPI_HOME/lib to class path but still i get this error. Can someone help.

Used this code to add the ReadyAPI_HOME jars in pom.xml

<plugin>
  <groupId>com.googlecode.addjars-maven-plugin</groupId>
  <artifactId>addjars-maven-plugin</artifactId>
  <version>1.0.5</version>
    <executions>
        <execution>
            <goals>
                <goal>add-jars</goal>
            </goals>
            <configuration>
                <resources>
                    <resource>
                       <directory>${basedir}/src/lib</directory>
                    </resource>
                </resources>
            </configuration>
        </execution>
    </executions>
</plugin>
user861594
  • 5,733
  • 3
  • 29
  • 45
  • Include jar file from READYAPI_HOME/bin directory. – Rao Apr 25 '18 at 06:46
  • There was only one jar in READYAPI_HOME/bin directory (ready-api-ui-2.3.0.jar) which was also added to the classpath. Still i get the error mentioned above – Aruna Nayagam Apr 25 '18 at 10:16
  • Why add the jars using this complicated and non-portable mechanism? Why not just add ReadyAPI jars as a normal dependency? – SiKing Apr 27 '18 at 19:33
  • READYAPI_HOME/lib directory has a lot of jars, adding them one by one as normal dependency is a tedious job. Do we have any alternate method? – Aruna Nayagam Apr 30 '18 at 08:58

1 Answers1

-1

You should try adding below dependency instead.

<dependency>
    <groupId>org.unitils.soapui</groupId>
    <artifactId>unitils-soapui</artifactId>
    <version>1.0.3</version>
</dependency>

You need to add following repository in pom

<repository>
    <id>smartbear</id>
    <url>http://smartbearsoftware.com/repository/maven2/</url>
    <releases>
        <enabled>true</enabled>
    </releases>
</repository>

If you want to use BDD for web service testing, you also can check qaf-ws-support

user861594
  • 5,733
  • 3
  • 29
  • 45
  • org.unitils is **not** in that repository! You should also provide some explanation why the OP should add some 3rd party dependency to his project. – SiKing Apr 27 '18 at 19:32
  • @user861594 I have added the repository but when i use unitils-soapui i get error as "Failed to collect dependencies at org.unitils.soapui:unitils-soapui:jar:1.0.3" – Aruna Nayagam Apr 30 '18 at 09:01