0

Currently we are using maven profiling to run testng test suites. Below is my profile

<profile>
    <id>BAT_All</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/main/resources/testplans/BAT_All.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>

In this case we are using below command to run all the test cases in BAT_All.xml file and working as expected

mvn clean install -PBAT_All

Now I need to run single test case using test case name. I tried with below command but its not working.

mvn clean install -Dtest=verify_Home_Page_Title

Is it possible to run single test case with maven profiling

try-catch-finally
  • 7,436
  • 6
  • 46
  • 67
Lucas
  • 167
  • 3
  • 15

1 Answers1

-1
mvn clean test -Dtest=classname#testname
Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
  • 4
    I doubt that this helps, or even works at all. To convince me otherwise please explain how this works and why it is supposed to help. – Yunnosch Dec 09 '20 at 21:19