volnoboy
volnoboy

Reputation: 192

Maven doesn't build project with surefire plugin in pom

I have a maven project with Selenium WebDriver tests using TestNG. I would like to run tests in groups, thats why is important to have surefire plugin in pom file, thats what i added to pom file: enter image description here

If i run my project after adding those words using maven(using testNG is still working), i get an error in console and WebDriver doesn't even open.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.15:test
(default-test) on project PORefactor: Execution default-test of goal 
org.apache.maven.plugins:maven-surefire-plugin:2.15:test failed: There was an error in 
the forked process.

and also :

[ERROR] Cannot find class in classpath: com.volnoboy.POImplementation

I tried to refresh and clean project. I moved project to a different computer and error is the same. Internet connection is good. What should i do?

Upvotes: 1

Views: 8932

Answers (1)

Héctor Flores
Héctor Flores

Reputation: 253

This is my pom

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.15</version>
            <configuration>
                <!-- <groups>1</groups> -->
                <suiteXmlFiles>
                    <suiteXmlFile>testSuites\testng1.xml</suiteXmlFile>
                    <suiteXmlFile>testSuites\testng1.xml</suiteXmlFile>
                </suiteXmlFiles>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.15</version>
        </plugin>

Try with that plugin.

And of course you need the testng and selenium dependecies in your pom.

Hope it helps.

Upvotes: 1

Related Questions