简体   繁体   中英

How to run selenium/junit teste case using maven command line

I'm trying to run an automated test from the command line, but when using the "mvn clean test" command, only the "BUILD SUCCESS" log is displayed, but the browser is not started and the test is not executed.

I'm using: - Junit 4

  • Selenium 3.141.59
  • Java 8
  • Eclipse IDE -Maven 3.6.0

Someone can help me?

I dont know what is happen.

You can add maven surefire plugin in your pom or failsafe:


    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>

        </plugins>
    </build>

Then try again running:

mvn clean test

All classses containing Test/Tests should be picked up

LOG:

[INFO] Running DummyTest
Test was executed
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.024 s - in DummyTest
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

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