PHP Web驱动程序-目标页面don';t在浏览器中加载


PHP Webdriver - target pages don't load in browser

Selenium 2的新功能。问题是:每次运行测试时,浏览器都会打开,但拒绝加载URL。我只是得到一张空白页。以下是使用Łukasz-Kolczyński绑定的示例:

require_once "phpwebdriver/WebDriver.php";
$webdriver = new WebDriver("localhost", "4444");
$webdriver->connect("chrome");                            
$webdriver->get("http://google.com");
$element = $webdriver->findElementBy(LocatorStrategy::name, "q");
if ($element) {
    $element->sendKeys(array("php webdriver" ) );
    $element->submit();
}
$webdriver->close();

我只是在地址栏中得到"data:text.html;charset=utf-8"。然后脚本关闭。

我确信我做错了什么。如有任何帮助,我们将不胜感激。

注意:我目前正在运行chromedriver、chrome 28、php 5.4.9和OpenJDK 64位服务器VM(构建23.7-b01,混合模式)

我也遇到了同样的问题。我无法让它发挥作用,最终选择使用facebook版本的网络驱动程序。

只要确保您使用的是最新版本的php,否则它将无法正常工作。

以下是链接:Facebook git位置:https://github.com/facebook/php-webdriver

经过24小时的沮丧,我得出结论,非官方的php绑定不值得麻烦。从Github上的一些反馈来看,我认为这是一个常见的抱怨。

我决定尝试一个官方API。Python实现非常有效。我发现学习一些Python并用新语言编写测试比解决PHP绑定问题更快。

既然我已经破坏了php代码,我相信我会发现我错过了一些明显的东西。:)