0

使用下面的代码(取自http://www.scalatest.org/user_guide/using_selenium

import org.scalatest.matchers.ShouldMatchers
import org.scalatest.selenium.WebBrowser
import org.scalatest.FlatSpec

class BlogSpec extends FlatSpec with ShouldMatchers with WebBrowser {

  implicit val webDriver: WebDriver = new HtmlUnitDriver

  "The blog app home page" should "have the correct title" in {
    go to (host + "index.html")
    title should be ("Awesome Blog")
  }
}

我收到错误

 Multiple markers at this line
    - not found: type HtmlUnitDriver
    - not found: type WebDriver

HtmlUnitDriver 和 WebDriver 库不是 scalatest 安装的一部分,我可以从哪里导入它们?

4

1 回答 1

2

我只需要 Selenium 依赖项(http://seleniumhq.org/download/maven.html):

<dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.24.1</version>
    </dependency>  
于 2012-12-11T10:39:44.667 回答