Ubuntu EC2上的Selenium、PHP单元和Firefox

Ubuntu EC2上的Selenium、PHP单元和Firefox,ubuntu,phpunit,selenium-rc,selenium-webdriver,Ubuntu,Phpunit,Selenium Rc,Selenium Webdriver,我正在尝试使用Selenium运行PHPUnit测试 我启动selenium: java -jar selenium-server-standalone-2.32.0.jar & 运行我的测试: phpunit --verbose suite/TestSuite.php 。。。这就是硒RC方面容易出错的地方。当Selenium尝试“准备Firefox配置文件…”时,会出现以下错误: ERROR - Failed to start new browser session, shutdo

我正在尝试使用Selenium运行PHPUnit测试

我启动selenium:

java -jar selenium-server-standalone-2.32.0.jar &
运行我的测试:

phpunit --verbose suite/TestSuite.php
。。。这就是硒RC方面容易出错的地方。当Selenium尝试“准备Firefox配置文件…”时,会出现以下错误:

ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: Timed out waiting for profile to be created!
所以我从中得到的是,新安装的Firefox没有创建原始配置文件,它希望为会话创建一个。显然,这需要很长时间,而硒正是因为它而超时

所以我尝试从Firefox的命令行创建一个配置文件,然后我就可以告诉Selenium使用它了

firefox -CreateProfile selenium
唉,没有快乐:

Error: cannot open display: :22
因为这是一个EC2实例,所以没有显示(X)。所以不知道我现在有什么选择。我试着用Chrome浏览器来运行PHPUnit测试,但不管出于什么原因,它仍然想创建一个Firefox配置文件。。。威士忌探戈


如果有人有任何建议,我将不胜感激。

像这样无头运行它:

export DISPLAY=:0.0
xvfb-run --auto-servernum --server-num=0 java -jar selenium-server-standalone-2.32.0.jar > /dev/null 2>&1 &

检查此链接是否有用。