【发布时间】:2011-06-09 06:47:39
【问题描述】:
我已经在 Windows 上安装了 phpunit 并复制了示例程序。将网址更改为 google.com
<?php
require_once 'PHPUnit/Autoload.php';
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class WebTest extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setBrowser('*firefox');
$this->setBrowserUrl('http://www.google.com/');
}
public function testTitle()
{
$this->open('http://www.google.com/');
$this->assertTitleEquals('Example Web Page');
}
}
?>
seleinum jar 正在运行:
20:37:24.855 INFO - Java: Sun Microsystems Inc. 20.0-b11
20:37:24.918 INFO - OS: Windows 7 6.1 x86
20:37:25.042 INFO - v2.0 [rc2], with Core v2.0 [rc2]
20:37:27.554 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:4444/wd/hub
20:37:27.570 INFO - Version Jetty/5.1.x
20:37:27.585 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
20:37:27.601 INFO - Started HttpContext[/selenium-server,/selenium-server]
20:37:27.601 INFO - Started HttpContext[/,/]
20:37:27.913 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@a981ca
20:37:27.913 INFO - Started HttpContext[/wd,/wd]
20:37:27.960 INFO - Started SocketListener on 0.0.0.0:4444
20:37:27.991 INFO - Started org.openqa.jetty.jetty.Server@1c29ab2
当我从命令行运行代码时,我得到Process finished with exit code 0
【问题讨论】:
标签: php windows selenium phpunit