How to configure cucumber and selenium in eclipse

649 views Asked by At

I want to work with cucumber and selenium by using eclipse IDE, but I need help, how can I set up maven project and whats are the dependencies should be added in pom.xml file, please provide me steps.

1

There are 1 answers

0
NarendraR On

I have following guidelines -

  1. Make sure maven in installed in your eclipse if not then first you need to do that
  2. Now create a simple Maven project and after success, edit the pom.xml file and add following dependencies under <project> tag -

     <dependencies>
            <dependency> 
               <groupId>org.seleniumhq.selenium</groupId> 
               <artifactId>selenium-java</artifactId> 
               <version>2.53.1</version> 
            </dependency>
    
            <dependency> 
               <groupId>info.cukes</groupId> 
               <artifactId>cucumber-java</artifactId> 
               <version>1.0.2</version> 
               <scope>test</scope> 
            </dependency>
    
                <dependency> 
                   <groupId>info.cukes</groupId> 
                   <artifactId>cucumber-junit</artifactId> 
                   <version>1.0.2</version> 
                   <scope>test</scope> 
                </dependency>
    
            <dependency> 
               <groupId>junit</groupId> 
               <artifactId>junit</artifactId> 
               <version>4.10</version> 
               <scope>test</scope> 
            </dependency>  
      </dependencies>
    

Once you are going to save the xml, it will downloaded all mentioned dependency jar files.

  1. Now create your cucumber test (feature file and step definition file) under src/test/java

For detailed description and learning refer cucumber tutorial link.