Testing Chrome WebDriver在Play 2中尝试测试时不工作

Testing Chrome WebDriver在Play 2中尝试测试时不工作,testing,playframework-2.0,selenium-chromedriver,fluentlenium,Testing,Playframework 2.0,Selenium Chromedriver,Fluentlenium,我正在尝试用Fluentlenium测试Play 2应用程序 这是其中一个测试用例的代码: import org.junit.*; import play.mvc.*; import play.test.*; import play.libs.F.*; import static play.test.Helpers.*; import static org.fest.assertions.Assertions.*; import static org.fluentlenium.core.f

我正在尝试用Fluentlenium测试Play 2应用程序

这是其中一个测试用例的代码:

import org.junit.*;

import play.mvc.*;
import play.test.*;
import play.libs.F.*;

import static play.test.Helpers.*;
import static org.fest.assertions.Assertions.*;

import static org.fluentlenium.core.filter.FilterConstructor.*;
public class IntegrationTest {

/**
 * Verify if the Login Page is rendered correctly
 */
@Test
public void LoginPage() {
    running(testServer(3333, fakeApplication(inMemoryDatabase())), HTMLUNIT_, new Callback<TestBrowser>() {
        public void invoke(TestBrowser browser) {
            browser.goTo("http://localhost:3333");
            assertThat(browser.pageSource()).contains("Login");
        }
    });
}
import org.junit.*;
导入play.mvc.*;
导入play.test.*;
导入play.libs.F.*;
导入静态play.test.Helpers.*;
导入静态org.fest.assertions.assertions.*;
导入静态org.fluentlenium.core.filter.FilterConstructor.*;
公共类集成测试{
/**
*验证登录页面是否正确呈现
*/
@试验
公共无效登录页(){
正在运行(testServer(3333,fakeApplication(inMemoryDatabase())),HTMLUNIT,新回调(){
公共void调用(TestBrowser浏览器){
browser.goTo(“http://localhost:3333");
资产(browser.pageSource())。包含(“登录”);
}
});
}
当我使用HTMLUNIT执行此操作时,它工作得很好,但是有些页面使用复杂的javascript,因此HTMLUNIT会在一些测试用例上中断

当我用FIREFOX替换HTMLUNIT时,它会启动FIREFOX,但不会在浏览器上执行任何操作

当我尝试使用CHROME时,它会给我一个“找不到符号”的编译错误。我尝试下载ChromeWebDriver并将其复制到“/usr/bin”文件夹中,但仍然不起作用

我不知道问题出在哪里。

您需要并且可能需要明确地告诉您的应用程序在哪里可以找到它,例如:

System.setProperty("webdriver.chrome.driver", System.getProperty("user.dir") + "/extra/chromedriver")

我在Firefox启动时也遇到了同样的问题,但什么也没有发生。Play框架中包含的最新Fluentlenium版本与最新Firefox版本中的更改不符

我要做的是升级Fluentlenium(目前版本为0.10.13)

// For Scala, add the latest fluentlenium dependency in build.sbt
libraryDependencies ++= Seq(
  <other dependencies of the project>
  "org.fluentlenium" % "fluentlenium-core" % "0.10.3" % "test"
)
sudo apt-get purge firefox
sudo apt-get install firefox=28.0+build2-0ubuntu2