3
votes

I created maven based Selenium project using TestNG framework. When i run command :- "mvn clean install" from the command prompt then my script runs fine but "test-output" folder doesn't created and if i run my script via Eclipse right click on testng.xml file--run and TestNGsuite then test-output folder created which contains reports.

i added plugins for surefire reports and same are working fine but at the same time i want "test-output" too folder also while running "mvn clean install" command from command prompt. pls suggest!!

because i want to configure the same in jenkins (using mvn clean install command) and want to send emailablerepots.html to my seniors.

below is my pom.xml:-

<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>mavenTestProject</groupId>
  <artifactId>MAVENprojectEmail</artifactId>
  <version>0.0.1-SNAPSHOT</version>



  <build>
        <!-- Source directory configuration -->
        <sourceDirectory>src</sourceDirectory>
        <plugins>
            <!-- Following plugin executes the testng tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.14.1</version>
                <configuration>
                    <!-- Suite testng xml file to consider for test execution -->
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
            <!-- Compiler plugin configures the java version to be usedfor compiling 
                the code -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>

                </configuration>
            </plugin>
        </plugins>
    </build>


  <dependencies>

     <!--  Selenium Java -->
    <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>2.53.1</version>
</dependency>


   <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.10</version>
</dependency>


  </dependencies>


</project>
1
Same is my situation. I am generating the Excel report by [link]automationtesting.in/… but the thing is it requires test-results.xml from test-output folder. That is not generated when I am using mvn test command.Vaibhav_Sharma

1 Answers

3
votes

I had the same problem. When I searched carefully I found all reports that previously were created in test-output folder here: ...\eclipse-workspace\<Project Name>\target\surefire-reports\