0
这里是我使用的pom.xml文件:找不到硒包,即使它在pom.xml文件中定义
<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>shiv</groupId>
<artifactId>xyz</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>ab</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<webdriver.version>2.53.0</webdriver.version>
<junit.version>4.12</junit.version>
<hamcrest.version>1.3</hamcrest.version>
<ghostdriver.version>1.1.0</ghostdriver.version>
<phantomjs-maven-plugin.version>0.7</phantomjs-maven-plugin.version>
<phantomjs.version>2.1.1</phantomjs.version>
</properties>
<dependencies>
<!-- Junit 4.11 needs hamcrest 1.3 -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>${webdriver.version}</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>2.53.0</version>
<scope>test</scope>
</dependency>
正如你可以看到我已经得到了最新版本的硒2.5。 3,仍然它给出了下面的错误:
[ERROR]编译错误:
[ERROR] /Users/sp/xyz/src/main/java/webdriver/manager/Driver.java:[6, 1]包org.openqa.selenium不存在
[错误] /Users/sp/xyz/src/main/java/webdriver/manager/Driver.java:[11,36] package org.openqa.selenium.html单元不存在
有没有什么是我的错过了?
因此,我添加了上述改变,它的工作原理,但仍然抱怨包“org.openqa.selenium”不存在。 –
尝试使用 org.seleniumhq.selenium 硒的Java 2.53.0 –
好吧,发现problem..for某种原因,它没有添加到我的课堂path..Thanks您帮助虽然..赞赏它.. –