1. Create a new MAVEN project, the Pom file is:
<Projectxmlns= "http://maven.apache.org/POM/4.0.0"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupId>Com.test</groupId> <Artifactid>Cucumber</Artifactid> <version>0.0.1-snapshot</version> <Packaging>Jar</Packaging> <name>Cucumber</name> <URL>http://maven.apache.org</URL> <Properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </Properties> <Dependencies> <Dependency> <groupId>Info.cukes</groupId> <Artifactid>Cucumber-core</Artifactid> <version>1.2.3</version> </Dependency> <Dependency> <groupId>Info.cukes</groupId> <Artifactid>Cucumber-java</Artifactid> <version>1.2.3</version> </Dependency> <Dependency> <groupId>Junit</groupId> <Artifactid>Junit</Artifactid> <version>4.12</version> </Dependency> <Dependency> <groupId>Info.cukes</groupId> <Artifactid>Cucumber-junit</Artifactid> <version>1.2.3</version> </Dependency> <Dependency> <groupId>Org.seleniumhq.selenium</groupId> <Artifactid>Selenium-java</Artifactid> <version>2.48.2</version> </Dependency> <Dependency> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-surefire-plugin</Artifactid> <version>2.12.4</version> </Dependency> <Dependency> <groupId>Org.picocontainer</groupId> <Artifactid>Picocontainer</Artifactid> <version>2.14</version> </Dependency> <Dependency> <groupId>Info.cukes</groupId> <Artifactid>Cucumber-picocontainer</Artifactid> <version>1.2.3</version> </Dependency> </Dependencies> <Build> <Plugins> <plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-surefire-plugin</Artifactid> <Configuration> <Forkmode>Once</Forkmode> <Argline>-dfile.encoding=utf-8</Argline> </Configuration> </plugin> </Plugins> </Build> </Project>
http://blog.csdn.net/yan1234abcd/article/details/49300995
Cumber + Selenium +java automated test