建立 Selenium Webdriver 的环境 ( setup a selenium webdriver project)

访问量: 1995

1. 安装好Maven后, 建立一个pom.xml 文件: (create a file named: pom.xml, assuming you have MAVEN installed. )

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=
"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>MySel20Proj</groupId>
        <artifactId>MySel20Proj</artifactId>
        <version>1.0</version>
        <dependencies>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>2.25.0</version>
            </dependency>
            <dependency>
                <groupId>com.opera</groupId>
                <artifactId>operadriver</artifactId>
            </dependency>
        </dependencies>
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>com.opera</groupId>
                    <artifactId>operadriver</artifactId>
                    <version>0.16</version>
                    <exclusions>
                        <exclusion>
                            <groupId>org.seleniumhq.selenium</groupId>
                            <artifactId>selenium-remote-driver</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </dependencyManagement>
</project>

2. 下载所有的依赖jar包。运行 $ mvn clean install ( run this command to download all the dependend -jar files. )

........ 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 59.955s
[INFO] Finished at: Fri Sep 28 10:42:29 CST 2012
[INFO] Final Memory: 7M/40M
[INFO] ------------------------------------------------------------------------

订阅/RSS Feed

Subscribe

分类/category