PHPUnit Selenium测试

时间:2013-03-18 18:31:43

标签: selenium phpunit

我在Selenium日志中收到以下错误:

19:20:33.341 DEBUG [151] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 2147483601 more secs
19:20:33.341 DEBUG [151] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms

在控制台中它挂起:

Allocated session f29d2b0c8a8b4118b52dae6288221190 for http://xxxxx.com?forceCacheClean=1, launching...
jar:file:/home/radu/selenium/selenium-server-standalone-2.31.0.jar!/customProfileDirCUSTFFCHROME
19:25:16.174 INFO - Preparing Firefox profile...
19:25:17.427 INFO - Launching Firefox...

我用:

运行服务器
java -jar /home/radu/selenium/selenium-server-standalone-2.31.0.jar -log /home/radu/selenium/log.txt -interactive -singleWindow

测试如下:

class WrongAuthTest extends PHPUnit_Extensions_SeleniumTestCase
{
  protected function setUp()
  {
    $this->setBrowserUrl("http://awesome.seventeenlive.com?forceCacheClean=1");
  }

  public function testLoginError()
  {
    $this->open("/");
    $this->waitForPageToLoad("10000");
    $this->type("id=LoginForm_username", "samsonradu");
    $this->type("id=LoginForm_password", "samsonradu");
    $this->click("name=login");
    $this->waitForPageToLoad("30000");
    $this->assertTrue($this->isTextPresent("Please Login To Continue"));
  }
}

运行Firefox 19。 这里有额外的设置吗?我必须在某处调用start()stop()吗? *注意,每次都不会在同一个地方发生。服务器在不同的测试用例中停止响应。

0 个答案:

没有答案