2012-03-20 18 views
0

我正在開發一個項目,在該項目中使用舊版本的Selenium - v0.9-2服務器。我將遷移到最新版本,但首先需要先讓這個版本開始工作,當然瞭解它在做什麼。這是使用這個框架Selenium - 新手老化版本在遷移之前工作

所以,我的第一次,我下的Eclipse靛藍使用Java 1.6和FF V9

我有一個用來啓動服務器,然後測試二Eclipse啓動文件運行。

所有測試擴展了我們定製的BaseTestCase類。

BaseTestCase不做任何事情,然後設置測試的東西。

這裏是正在使用的

private static String TEST_SERVER = "localhost"; 
    private static int TEST_SERVER_PORT = 5555; 
// private static String TEST_BROWSER = "*firefox c:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe"; 
    private static String TEST_BROWSER = "*custom C:/Program Files (x86)/Mozilla Firefox/firefox.exe -firefoxProfileTemplate C:/temp/selenium-profile"; 
    public static String TARGET_URL = "http://w7001lt8001prd:9080"; 
    private static String TARGET_ROOT_PATH = "apps/gtgo.html"; 

利用第二TEST_BROWSER設置我能現在帶來了FF但是測試仍然沒有執行配置設置。

在這個類的設置方法,我們稱之爲硒是這樣的:

selenium = new DefaultSelenium(TEST_SERVER, TEST_SERVER_PORT,TEST_BROWSER, TARGET_URL); 
    selenium.start(); 

有是用於打開根頁面的方法 - 那麼這將利用TARGET_ROOT_PATH的

當我啓動這裏的服務器的輸出:

(server.SeleniumServer    565) Java: Sun Microsystems Inc. 20.4-b02 
(server.SeleniumServer    566) OS: Windows 7 6.1 amd64 
(server.SeleniumServer    686) v0.9.2-SNAPSHOT [2001], with Core v0.8.3-SNAPSHOT [1875] 
(http.HttpServer      684) Version Jetty/5.1.x 
(util.Container      74 ) Started HttpContext[/selenium-server/driver,/selenium-server/driver] 
(util.Container      74 ) Started HttpContext[/selenium-server,/selenium-server] 
(util.Container      74 ) Started HttpContext[/,/] 
(http.SocketListener     204) Started SocketListener on 0.0.0.0:5555 
(util.Container      74 ) Started [email protected] 

當我啓動這裏的測試套件是輸出

(util.Credential      60 ) Checking Resource aliases 
(server.SeleniumDriverResourceHandler 391) Command request: getNewBrowserSession[*custom C:/Program Files (x86)/Mozilla Firefox/firefox.exe -firefoxProfileTemplate C:/temp/selenium-profile, http://w7001lt8001prd:9080] on session null 
(server.SeleniumDriverResourceHandler 586) Launching session 605798 

FF啓動,但我出其中指出,它無法連接單個標籤:火狐不能建立一個連接到服務器w7001lt8001prd:9080

上是怎麼回事上的任何方向讓這個工作。

回答

0

事實證明,爲了完成所有工作,需要安裝FireFox的正確版本 - 將Firefox主目錄放入路徑中時需要安裝4.0或更低版本。一旦完成,我現在可以運行測試套件。下一步 - 遷移到版本2.