Creating First Maven Project in Eclipse

Here  i am posting new post to create new maven project that i have learned from various sites and blot  and i got this very useful and want to share this with people who are also like me, and has started learning Selenium from scratches.

1- In Eclipse File ->New-> Other-> Maven-> Maven Project

2- Now Click Next, Next and Next
3- Type in field Group Id: com.Projectgroup.selenium Example com.Dwarika.selenium
4-Type in field Artifact Id: projectname Example : Webdriver
5-Click: Finish

After this you will see the hierarchical structure like this in Eclipse  where you would be able to see pom.xml in which you put all dependencies for your Maven Project

In Above snap number 4 you would be able to see the dependencies for junit and Slenenium

Dependencies that we need to change as per the use

1) We will change junit version to 4.7 or recent one is 4.9

in my case i have taken version for junit is 4.7

To add dependecy for Selenium we need to put this like given below

11 comments

  • This site was… how do I say it? Relevant!

    ! Finally I’ve found something that helped me. Thank you!

  • Oh my goodness! Impressive article dude! Many thanks,
    However I am experiencing issues with your RSS. I don’t understand the reason why I cannot subscribe to it. Is there anybody else having the same RSS issues? Anybody who knows the answer can you kindly respond? Thanks!!

  • Can we have maven+webdriver+testng configuration on pom?

    • in place of junit place testng everywhere between groupid and artifactid tag in version tag place 6.8 and keep scope same as test.
      In the same way place org.seleniumhq.selenium between groupid tag and
      selenium-java in artifactid tag and in version tag put 2.30.0.

  • Hi,
    I have to test a application by Jbehave framework .
    If you have any knowledge pls share means if you can make the framework more simplified
    then please contact me in [email protected]

  • Hi dude it’s very need full info

  • Pingback: Selenium Best Links | Learn Testing

  • Pingback: Installing Maven Plugin in Eclipse | Abode QA

  • Hi,
    I have created a maven project by following your steps. I have added the dependency in pom.xml
    I have created a package under src/test/java and added a .java file under that.
    I can see a red mark in the project name and when i can create a webdriver instance, but when I try write the code as
    WebDriver driver= new FirefoxDriver();
    driver.
    after “driver.” what ever code i write it shows error message and doesnot allow me to write any code.

    Do i need to do any configuration setting once i create the maven project, like configure build path and all….

    and if i have multiple class files and wanted to run all the .java files then do i need to do any configuration to setting to ran all the files at a time.

    • It would be grat if you can give some glance, how to run the maven project using popm.xml.
      Wthat are configuration setting required before run?

  • Pingback: Installing Maven Plugin in Eclipse | Abode QA

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.