2016-08-24 30 views
1

Firefox最近已經更新,現在版本爲48.0,導致我的-htmlSuite測試失敗。我從Firefox收到此錯誤信息:如何在Selenium 3中運行或遷移html測試套件?

Firefox can’t find the file at chrome://src/content/TestRunner.html 

我目前使用Selenium服務器版本2.53.1來運行我的測試中它被記錄在Firefox中硒IDE插件,然後自動在我OS X開發服務器。

這些測試的目的是提供任何網站的每日摘要,如果腳本無法導航到網站的購買工作流程的末尾,則需要對其進行審查。下面是我寫的推出我的功能測試bash腳本:

#!/bin/bash 
java -jar selenium-server-standalone-2.53.1.jar 
    -htmlSuite "*firefox" "http://www.insureone.com" 
       "/SeleniumTests/InsureOne-Suite.html" 
       "/SeleniumTests/InsureOne-Results.html" > /dev/null 

java -jar selenium-server-standalone-2.53.1.jar 
     -htmlSuite "*firefox" "http://www.aaffordableauto.com"    
     "/SeleniumTests/A-Affordable-Suite.html" 
     "/SeleniumTests/A-Affordable-Results.html" > /dev/null 

echo "Finished" 

下面是InsureOne套房的唯一的測試片段,通過前兩頁導航:

InsureOne-Test 
setTimeout 60000 
open / 
sendKeys id=zipcode 60610 
sendKeys id=phone 3126548045 
select id=year label=2006 
waitForElementPresent //option[contains(.,'PONTIAC')] 
select id=make label=PONTIAC 
waitForElementPresent //option[contains(.,'G6')] 
select id=model label=G6 
clickAndWait //button[contains(.,'Free Quote')] 
setTimeout 120000 
waitForElementPresent id=getquote 
setTimeout 60000 
clickAndWait id=getquote 

這些測試與運行Automator,然後結果每天早上通過電子郵件發送給我,以供審查。

我原本試圖使用最新版本的Selenium來啓動我的測試,但無法得到這個工作。我一直無法在Selenium文檔中找到任何東西來幫助我使用最新版本的Selenium運行html測試套件。

我不希望在Jenkins + Maven或其他語言中的等價物中運行自動構建和正式單元測試增加的複雜性。有沒有一種方法可以通過shell腳本在Selenium 3中執行此操作?

java -jar selenium-server-standalone-3.0.0-beta2.jar 
     -htmlSuite "*firefox" "http://www.aaffordableauto.com"    
     "/SeleniumTests/A-Affordable-Suite.html" 
     "/SeleniumTests/A-Affordable-Results.html" > /dev/null 

此命令導致NullPointerException。我被卡住了,因爲SeleniumHQ沒有關於如何讓這個工作或者遷移到最新版本上的建議。

+1

你可能想看看這個開放的錯誤:https://github.com/SeleniumHQ/selenium/issues/2616 –

+0

我試圖得到它針對Firefox的開發者版運行以及與xpinstall.signatures。需要設置爲false(https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox?as=u&utm_source=inproduct),但沒有成功。它啓動,但由於某種原因測試套件文件是錯誤的。 java -jar selenium/selenium-server-standalone-2.53.1.jar -htmlSuite「* firefox /Applications/FirefoxDeveloperEdition.app/Contents/MacOS/firefox-bin」「baseURL」「/ path/to/test/suite 「」/結果/文件「 –

+1

Selenium開發人員告訴我Selenium 3 Beta 3將包含用於運行htmlSuite腳本的遺留jar文件。 – B2K

回答

1

我還有另一個解決方法,切換到ChromeDriver允許我再次在selenium-server-standalone-2.53.1上運行測試。我不得不修改我的bash腳本來忽略由Selenium的代理證書導致的ssl錯誤。

#!/bin/bash 
java -jar selenium-server-standalone-2.53.1.jar 
    -trustAllSSLCertificates 
    -htmlSuite "*googlechrome" "http://www.aaffordableauto.com" 
       "/SeleniumTests/A-Affordable-Suite.html" 
       "/SeleniumTests/A-Affordable-Results.html" > /dev/null 

java -jar selenium-server-standalone-2.53.1.jar 
    -trustAllSSLCertificates 
    -htmlSuite "*googlechrome" "http://www.insureone.com" 
       "/SeleniumTests/InsureOne-Suite.html" 
       "/SeleniumTests/InsureOne-Results.html" > /dev/null 

echo "Finished" 
相關問題