2010-04-12 100 views
3

我在使用JUnit打開瀏覽器使用硒RC時出現以下錯誤。 Plz的幫助。使用JUnit打開瀏覽器時使用硒RC的錯誤

com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://www.google.com/ Response_Code = 403 Error_Message = Forbidden 
at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) 
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand 

回答

1

我建議設置爲startURL您想要測試的網站的IP地址。

另請參閱此SO answer

+0

即使這是行不通的。我想它必須做一些與瀏覽器的代理設置,因爲我正在訪問互聯網throgh代理服務器。我需要提及Selenium RC中某處的代理服務器設置。 – Arvind 2010-04-12 11:49:01

+0

@Arvind:也許像'java -jar selenium-server.jar -Dhttp.proxyHost = my.proxy.com -Dhttp.proxyPort = 8080 -Dhttp.proxyUser = my_username -Dhttp.proxyPassword = my_password'如http:// wiki.openqa.org/display或http://seleniumhq.org/docs/05_selenium_rc.html#server-options/SRC/Proxy+Configuration+for+the+Selenium+Server – VonC 2010-04-12 12:03:01

相關問題