使用以下代码(取自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& Web驱动程序库不属于最安装的安装,我可以从哪里导入它们?
答案 0 :(得分:2)
我只需要Selenium依赖(http://seleniumhq.org/download/maven.html):
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.24.1</version>
</dependency>