2013-07-30 28 views
2

我完全無所適從,試圖運行一個最小的Selenium RC風格測試。我遇到的問題已經被網絡上的很多用戶所描述,但是在我的情況下,不同的解決方案都不能解決這個問題。會發生什麼情況是Firefox會打開,但看起來像是一個空白的配置文件,因爲它打開了「歡迎使用Firefox!」頁。除此之外,什麼也沒有發生在瀏覽器和硒服務器日誌,我覺得這一點:Selenium RC:「等待窗口'null'本地框架'null'」

DEBUG [12] org.openqa.selenium.server.browserlaunchers.BrowserLauncherFactory - Requested browser string '*firefox c:\progra~2\mozill~1\firefox.exe' matches *firefox 
DEBUG [12] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Checking whether Firefox 3 launcher at :'c:\progra~2\mozill~1\firefox.exe' is valid... 
DEBUG [12] org.openqa.selenium.browserlaunchers.locators.BrowserLocator - Discovered valid Firefox 3 launcher : 'c:\progra~2\mozill~1\firefox.exe' 
INFO [12] org.openqa.selenium.server.BrowserSessionFactory - Allocated session 962d2221ccb4459b9adbad1b8734850c for http://www.google.com, launching... 
DEBUG [12] org.openqa.selenium.server.browserlaunchers.ResourceExtractor - Extracting /customProfileDirCUSTFFCHROME to C:\Users\zb\AppData\Local\Temp\customProfileDir962d2221ccb4459b9adbad1b8734850c 
INFO [12] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Preparing Firefox profile... 
INFO [12] org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher - Launching Firefox... 
DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for window 'null' local frame 'null' for 1800 more secs 
DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - waiting for condition for 1000 more ms 
DEBUG [12] org.openqa.selenium.server.FrameGroupCommandQueueSet - got condition? : false 

最後三行然後重複每一秒,直到我再次停止Selenium服務器。

這是我的測試代碼:

import com.thoughtworks.selenium.DefaultSelenium; 
public class Runner { 
    public static void main(String[] args) { 
     DefaultSelenium selenium = new DefaultSelenium("localhost", 4444, 
      "*firefox c:\\progra~2\\mozill~1\\firefox.exe", 
      "http://www.google.com"); 
     selenium.start(); 
     selenium.open("/"); 
     selenium.type("q", "test"); 
     selenium.click("btnK");  
     selenium.stop(); 
    } 
} 

我想:

  • 不同版本的Firefox(22,21,20)
  • 不同版本的Selenium服務器(2.33.0的, 2.25.0,2.15.0,CI構建)
  • 不同版本的Selenium客戶端驅動程序
  • 不同版本的甲骨文JDK(1.6u24,1.6u45,32位和64位版本)
  • 各種Firefox瀏覽器發射的測試代碼
  • 指定在所測試的代碼或運行硒服務器管理員瀏覽器路徑不
  • 或不是
  • 各種Selenium服務器選項(帶/不帶自定義配置文件,多窗口模式等)
  • Firefox和自定義配置文件的不同位置(即路徑與輸入/輸出空格)
  • 一個類似的測試類似於Java一個上面,用Perl編寫

這一切都沒有幫助就像我上面描述結束。我在Windows 7機器上(64位)。順便說一下,我嘗試的一個小型WebDriver測試如預期的那樣工作。

編輯:重命名的問題,因爲服務器沒有實際「掛起」,它只是不按預期方式工作。

+0

爲什麼不切換到WebDriver呢?不要忘了,Selenium-RC現在已被正式棄用,大部分的開發工作都在WebDriver上完成...... –

+0

真的......但我寧願讓測試運行,然後開始遷移。這是一套龐大的測試。 – zb226

+0

你可以用firefox 12試試標準版和2.25.0嗎? –

回答

1

我回到了Firefox 17 ESR(Extended Support Release),突然間測試恢復了生命(使用Selenium服務器2.33.0)。

此問題似乎是Selenium服務器和Firefox之間版本不兼容的指標。不幸的是,關於這個問題的文檔中找不到什麼或者什麼東西 - 但是,@Pavel Janicek提到的Selenium RC已經被棄用了。我從CHANGELOG得知的一點是,Selenium服務器2.32.0明確支持Firefox 10 ESR,17 ESR,19和20.對於2.33.0,沒有提及其他瀏覽器版本,因此Firefox 21+在官方不受支持, although not everyone agrees

把它包起來:如果您看到這個錯誤,唯一的解決辦法可能是下臺支持的瀏覽器列表在當前更新日誌,直到你的測試再次運行。