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
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 swayambehura@gmail.com
Hi dude it’s very need full info
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?