简体   繁体   中英

Can Execution be possible without using testng.xml file and using only pom.xml file in selenium java POM project?

How to execute Testng and Maven without testng.xml file using only pom.xml file

No , it wouldn't be possible to execute Testng based Test Suite to be executed only through Maven ie using only pom.xml without using testng.xml .

You need to configure Maven ie pom.xml with the desired testng.xml file as a mandatory configuration as follows:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.17</version>
    <configuration>
        <suiteXmlFiles>
            <suiteXmlFile>${suiteXmlFile}</suiteXmlFile>
        </suiteXmlFiles>
    </configuration>
</plugin>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM