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

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.9</version>
  <scope>test</scope>
</dependency>

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

  org.seleniumhq.selenium
  selenium-java
  2.6.0

-- Here Eclipse will detect changes in pom.xml automatically and will download or update all dependencies as per the requirement
-- After the build is finished, there should be selenium*.jar files under Maven Dependencies under the explorer pane

Dwarika Dhish Mishra

My name is Dwarika Dhish Mishra, its just my name and I am trying to bring the worth of my name in to actions and wants to be the solution not the problem. I believe in spreading knowledge and happiness. More over I am fun loving person and like travelling a lot. By nature I am a tester and a solution maker. I believe in the tag line of http://ted.org “Idea worth spreading” . For the same, I have created this blog to bring more and more learning to tester fraternity through day to day learning in professional and personal life. All contents are the part of my learning and so are available for all..So please spread the contents as much as you can at your end so that it could reach to every needful people in testing fraternity. I am pretty happy that more and more people are showing interest to become the part your Abode QA blog and I think this is good sign for us all because more and more content would be before you to read and to cherish. You may write or call me at my Email id: dwarika1987@gmail.com Cell: 9999978609

You may also like...

11 Responses

  1. Gisele says:

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

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

  2. Miriam says:

    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!!

  3. 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.

  4. swayam says:

    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 swayambehura@gmail.com

  5. Mahesh says:

    Hi dude it’s very need full info

  6. Hruda says:

    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.

    • Hruda says:

      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?

Leave a Reply

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