How can I integrate Selenium with Maven project

0 votes
How can I integrate Selenium with Maven project?
Jul 17, 2019 in Selenium by Vicky
2,347 views

1 answer to this question.

0 votes

Hey Vicky, follow these steps to integrate Selenium with Maven Project:

  1. In Eclipse IDE, select Help-> Install New Software from Eclipse Main Menu.

  2. On the Install dialog, Enter the URL http://download.eclipse.org/technology/m2e/releases/. Select Work with and Maven Integration for Eclipse plugin and Click on Next button as shown in the following screenshot and finish installation:

  3. With m2e plugin is installed, create a new project by selecting File-> New-> Other from Eclipse menu.

  4. On the New dialog, select Maven-> Maven Project and click Next

  5. On the New Maven Project dialog select the Create a simple project and click Next

  6. Enter MavenTest in Group Id: and Artifact Id: and click finish

  7. Select pom.xml file under MavenTest from Project Explorer, pom.xml file will Open in Editor section

  8.  Add the Selenium, Maven, TestNG, Junit dependencies to pom.xml in the <project> node:

    • <dependencies>			
              <dependency>				
                   <groupId>junit</groupId>								
                   <artifactId>junit</artifactId>								
                   <version>3.8.1</version>								
                   <scope>test</scope>								
              </dependency>				
              <dependency>				
                  <groupId>org.seleniumhq.selenium</groupId>								
                  <artifactId>selenium-java</artifactId>								
                  <version>2.45.0</version>								
      		</dependency>				
              <dependency>				
                  <groupId>org.testng</groupId>								
                  <artifactId>testng</artifactId>								
                  <version>6.8</version>								
                  <scope>test</scope>							  			
             </dependency>				
      </dependencies>

And you are done. Now you can create test cases and suites and run them as Maven projects.

answered Jul 17, 2019 by Abha
• 28,140 points

Related Questions In Selenium

+2 votes
2 answers

How can I press ENTER key with the execute_script in selenium python?

The below code containing Keys.ENTER might just ...READ MORE

answered Mar 28, 2018 in Selenium by nsv999
• 5,500 points
27,378 views
0 votes
1 answer

How can I handle certificates when testing pages with Selenium?

In Firefox, you should set 'accept_untrusted_certs' of ...READ MORE

answered May 8, 2018 in Selenium by king_kenny
• 3,710 points
11,781 views
0 votes
1 answer

How can I write test scripts in Selenium with python?

Hey Khushi, writing test scripts in Selenium ...READ MORE

answered May 9, 2019 in Selenium by Anvi
• 14,150 points
902 views
0 votes
1 answer

How can I use HTML Unit Driver as a headless browser with Selenium?

Hello @Nishant, follow these steps to use ...READ MORE

answered May 17, 2019 in Selenium by Anvi
• 14,150 points
4,259 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
+2 votes
1 answer
0 votes
1 answer

How can I add Cucumber Jar files in Eclipse to use with Selenium Webdriver?

Hey Eshan, follow these steps to add ...READ MORE

answered May 23, 2019 in Selenium by Abha
• 28,140 points
5,978 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP