3

下载了 InternetExplorerDriver,但我不知道如何在 php 测试中启动它。我正在使用https://github.com/chibimagic/WebDriver-PHP/

4

3 回答 3

5
  1. 从站点https://code.google.com/p/selenium/downloads/list下载 selenium-server-standalone-2.31.0.jar

  2. 从站点https://code.google.com/p/selenium/downloads/list下载 IEDriverServer_Win32_2.31.0.zip ,然后解压缩

  3. 将两个下载的文件添加到一个目录中,并将此目录添加到系统变量路径

  4. 将 C:\Program Files\Internet Explorer 添加到系统变量路径中

  5. 打开命令提示符类型

    java -jar -Dwebdriver.ie.driver=IEDriverServer.exe selenium-server-standalone-2.31.0.jar

  6. 返回到您的 webdriver 设置并将“firefox”更改为“internet explorer”

  7. 然后就可以在ie中开始测试了,但是别忘了把ie的默认缩放比例从125%改成100%。

于 2013-03-18T14:42:50.797 回答
0

不要传递“firefox”,而是传递“internet explorer”:

$this->setBrowser('internet explorer');
于 2012-10-05T15:49:59.103 回答
0

用法
请参阅包含的 SampleTest.php。启动 Selenium 2 独立服务器 (http://code.google.com/p/selenium/downloads/list) 并运行测试:

phpunit SampleTest.php

确保 phpunit 在你的路径中!

测试
什么是没有测试的代码?运行测试:

phpunit WebDriverSelectorTest.php
phpunit WebDriverXPathTest.php
phpunit WebDriverColorTest.php
于 2012-08-16T08:04:20.297 回答