0

I have a Maven Project in eclipse. On running pom.xml file it runs my 2 tests mentioned on path- src/test/java/pakage. But,When I check the test results in index.html file in the test-output folder - it shows only 1 test that too method name and class name is not correct.

Also in the info section of htlml file, location is little weird- shows like this -C:\Users..\AppData\Local\Temp\testng-eclipse--1598554117\testng-customsuite.xml (I am expecting my Project location which is- d drive).

Not sure what is going wrong.can somebody plz help.

My pom.xml is like this-

<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>Maven_demo</groupId>
  <artifactId>Maven_Project</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>maven-plugin</packaging>

  <name>Maven_Project</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.11.0</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
  </dependencies>
</project>

my Project structure is like this- img attached --https://i.stack.imgur.com/1FqDe.jpg

Samira
  • 33
  • 9
  • You would have to create suite.xml mentioning your Testclass files (in your case as you have 2 TestClasses containing your tests , your suite.xml file should contain those 2 TestClasses path) & then specify that suite.xml in your pom.xml using maven surefire plugin – sjethvani Jun 25 '18 at 10:12
  • First test is on plain command line... – khmarbaise Jun 25 '18 at 10:41
  • @khmarbaise ok..but then it should at least show the correct name of method for 2nd test. – Samira Jun 25 '18 at 11:14
  • BTW: Which of the testing frameworks do you use? TestNG or JUnit ? – khmarbaise Jun 25 '18 at 11:48

0 Answers0