2012-08-16 63 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%。