2012-08-16 64 views

回答

0

使用
查看包含SampleTest.php。启动硒2独立的服务器(http://code.google.com/p/selenium/downloads/list),并运行测试:

phpunit SampleTest.php 

确保PHPUnit的是在您的路径!

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

phpunit WebDriverSelectorTest.php 
phpunit WebDriverXPathTest.php 
phpunit WebDriverColorTest.php 
+1

问题是关于使用[InternetExplorerDriver(http://selenium.googlecode.com/files/IEDriverServer_Win32_2.25.3.zip) – 2012-08-16 12:17:38

+1

你不能在浏览器中使用该程序运行HOWTO现有PHPUnit测试,使用PHP CLI(命令行界面) – Julien 2012-08-16 12:34:38

+0

@ atmon3r [SampleTest.php](https://github.com/chibimagic/WebDriver-PHP/blob/master/SampleTest.php)被硬编码为使用Firefox。问题是他必须在该文件中更改哪些内容才能使用Internet Explorer而不是Firefox。 – 2012-08-16 23:55:09

0

强似 '火狐' 的,通过 'Internet Explorer的':

$this->setBrowser('internet explorer'); 
5
  1. 下载来自网站 https://code.google.com/p/selenium/downloads/list硒的服务器独立,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设置和更改 '火狐' 到' Internet Explorer'

  7. 然后你就可以在ie中开始测试,但是不要忘记改变ie的默认缩放比例,从125%到100%。