Run selenium tests using maven – Maven in eclipse part3


In our earlier posts Maven in eclipse – part1 and Maven in eclipse – part2, we have seen how to setup and use maven in eclipse.

in this article, we will look into how to run selenium tests using maven build in eclipse.

NOTE: we need not to download any of the jar file needed to run selenium tests, maven POM.xml will take care of that, so when we move our selenium tests to any of the machines, we can run tests irrespective of the version of jar files or downloaded jar files.

  • Create selenium test as testNG class – under src/test/java

  • testng.xml – place under project folder

  • pom.xml – place under project folder

Under dependency tags, you can change the version of the jar files that you want to download, respective jar files will be downloaded under local repository before running the maven test.

now, right click on pom.xml -> Run As -> Maven test to run test.


Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *