Could't run testng.xml via surefire plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Could't run testng.xml via surefire plugin

Magesh N
Info about my project: IAnnotationTransformer is used to send data to test methods like
@Test(priority = 1, description = "TC_Folder_DocumentTab_Add") //
public void TC_Folder_DocumentTab_Add(**HashMap<String, String> data**) throws Exception {  /.../ }
when i run my testng.xml as TestNg Suite, it runs perfectly but when i try to run with pom.xml(maven-surefire-plugin) it throws the following error:
 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project selenium-backoffice: There are test failures.
    [ERROR] 
    [ERROR] Please refer to D:\Amanda\New_Automation_AMANDA\selenium-backoffice\target\surefire-reports for the individual test results.
    [ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
    [ERROR] There was an error in the forked process
    [ERROR] org/apache/poi/UnsupportedFileFormatException
    [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
    [ERROR] org/apache/poi/UnsupportedFileFormatException
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:658)
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
    [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
    [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
    [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
    [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:497)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Here is my testng.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
    <suite name="Suite">
    <test thread-count="5" name="Test">
        <classes>
            <class name="com.csdcsystems.selenium.backoffice.suite.DocumentTabSuite"/>
        </classes>
    </test> <!-- Test -->
    </suite> <!-- Suite -->

Here is my pom.xml:

    <?xml version="1.0"?>
    <project
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
        xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <modelVersion>4.0.0</modelVersion>
        <!-- <parent>
            <groupId>com.ddd</groupId>
            <artifactId>amanda</artifactId>
            <version>7.0.0.0</version>
        </parent> -->
        <groupId>com.ddd</groupId>
        <artifactId>selenium-backoffice</artifactId>
        <version>7.0.0.0</version>
        <name>AMANDA Selenium backoffice</name>
        <packaging>jar</packaging>
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>3.8.1</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-server</artifactId>
                <version>3.8.1</version>
            </dependency>
    <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
          </dependency>

            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>3.10.1</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.8.8</version>
            </dependency>

            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            <dependency>
                <groupId>com.aventstack</groupId>
                <artifactId>extentreports</artifactId>
                <version>3.1.2</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.11</version>
            </dependency>
        </dependencies>

        <build>
            <finalName>selenium-backoffice</finalName>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>2.9</version>
                    <configuration>
                        <downloadSources>true</downloadSources>
                        <downloadJavadocs>true</downloadJavadocs>
                        <wtpversion>2.0</wtpversion>
                    </configuration>
                </plugin>
                 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.21.0</version>
                    <configuration>
                    <properties>
                <property>
                  <name>usedefaultlisteners</name>
                  <value>false</value> <!-- disabling default listeners is optional -->
                </property>
                <property>
                  <name>listener</name>
                  <value>/selenium-backoffice/src/main/java/com/testng/listeners/ExecutionListener.java,
                  /selenium-backoffice/src/main/java/com/testng/listeners/MethodInvocationListener.java,
                  /selenium-backoffice/src/main/java/com/testng/listeners/AnnotationTransformerListener.java</value>
                </property>
              <!--  <property>
                  <name>reporter</name>
                  <value>listenReport.Reporter</value>
                </property> --> 
              </properties>             
                        <suiteXmlFiles>
                          <suiteXmlFile>testng.xml</suiteXmlFile>               
                        <!--    <suiteXmlFile>xml_suites\suite_BO.xml</suiteXmlFile>-->     
                        </suiteXmlFiles>
                    </configuration>
                </plugin> 

            </plugins>
        </build>
        <reporting>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>2.5.2</version>
                    <configuration>
                        <fork>false</fork>
                        <timeout>3000000</timeout>
                    </configuration>
                </plugin>
            </plugins>
        </reporting>
    </project>


I'm completely struck now, any help would be highly appreciated.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Could't run testng.xml via surefire plugin

Krishnan Mahadevan
You should start by fixing this error :

[ERROR] org/apache/poi/UnsupportedFileFormatException


On Mon, Apr 2, 2018, 10:20 Magesh N <[hidden email]> wrote:
Info about my project: IAnnotationTransformer is used to send data to test methods like
@Test(priority = 1, description = "TC_Folder_DocumentTab_Add") //
public void TC_Folder_DocumentTab_Add(**HashMap<String, String> data**) throws Exception {  /.../ }
when i run my testng.xml as TestNg Suite, it runs perfectly but when i try to run with pom.xml(maven-surefire-plugin) it throws the following error:
 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project selenium-backoffice: There are test failures.
    [ERROR] 
    [ERROR] Please refer to D:\Amanda\New_Automation_AMANDA\selenium-backoffice\target\surefire-reports for the individual test results.
    [ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
    [ERROR] There was an error in the forked process
    [ERROR] org/apache/poi/UnsupportedFileFormatException
    [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
    [ERROR] org/apache/poi/UnsupportedFileFormatException
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:658)
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
    [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
    [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
    [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
    [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
    [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    [ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    [ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
    [ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
    [ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [ERROR] at java.lang.reflect.Method.invoke(Method.java:497)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    [ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:

Here is my testng.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
    <suite name="Suite">
    <test thread-count="5" name="Test">
        <classes>
            <class name="com.csdcsystems.selenium.backoffice.suite.DocumentTabSuite"/>
        </classes>
    </test> <!-- Test -->
    </suite> <!-- Suite -->

Here is my pom.xml:

    <?xml version="1.0"?>
    <project
        <modelVersion>4.0.0</modelVersion>
        <!-- <parent>
            <groupId>com.ddd</groupId>
            <artifactId>amanda</artifactId>
            <version>7.0.0.0</version>
        </parent> -->
        <groupId>com.ddd</groupId>
        <artifactId>selenium-backoffice</artifactId>
        <version>7.0.0.0</version>
        <name>AMANDA Selenium backoffice</name>
        <packaging>jar</packaging>
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <maven.compiler.source>1.8</maven.compiler.source>
            <maven.compiler.target>1.8</maven.compiler.target>
        </properties>
        <dependencies>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>3.8.1</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-server</artifactId>
                <version>3.8.1</version>
            </dependency>
    <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
          </dependency>

            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi</artifactId>
                <version>3.10.1</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.8.8</version>
            </dependency>

            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.17</version>
            </dependency>
            <dependency>
                <groupId>com.aventstack</groupId>
                <artifactId>extentreports</artifactId>
                <version>3.1.2</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.11</version>
            </dependency>
        </dependencies>

        <build>
            <finalName>selenium-backoffice</finalName>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>2.9</version>
                    <configuration>
                        <downloadSources>true</downloadSources>
                        <downloadJavadocs>true</downloadJavadocs>
                        <wtpversion>2.0</wtpversion>
                    </configuration>
                </plugin>
                 <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.21.0</version>
                    <configuration>
                    <properties>
                <property>
                  <name>usedefaultlisteners</name>
                  <value>false</value> <!-- disabling default listeners is optional -->
                </property>
                <property>
                  <name>listener</name>
                  <value>/selenium-backoffice/src/main/java/com/testng/listeners/ExecutionListener.java,
                  /selenium-backoffice/src/main/java/com/testng/listeners/MethodInvocationListener.java,
                  /selenium-backoffice/src/main/java/com/testng/listeners/AnnotationTransformerListener.java</value>
                </property>
              <!--  <property>
                  <name>reporter</name>
                  <value>listenReport.Reporter</value>
                </property> --> 
              </properties>             
                        <suiteXmlFiles>
                          <suiteXmlFile>testng.xml</suiteXmlFile>               
                        <!--    <suiteXmlFile>xml_suites\suite_BO.xml</suiteXmlFile>-->     
                        </suiteXmlFiles>
                    </configuration>
                </plugin> 

            </plugins>
        </build>
        <reporting>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>2.5.2</version>
                    <configuration>
                        <fork>false</fork>
                        <timeout>3000000</timeout>
                    </configuration>
                </plugin>
            </plugins>
        </reporting>
    </project>


I'm completely struck now, any help would be highly appreciated.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.