錯誤信息1:
FAILED CONFIGURATION: @BeforeClass setUp
java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: Unable to delete file C:\Users\ADMINI~1\AppData\Local\Temp\customProfileDir9cf2c422885b4bb683e8f836a80a58be\parent.lock
原因:ff3.6與selenium1.0.1不兼容,服務器端使用selenium1.0.2以上的版本即可
錯誤信息2:
java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: java.lang.RuntimeException: Firefox 3 could not be found in the path!
Please add the directory containing ''firefox.exe'' to your PATH environment
variable, or explicitly specify a path to Firefox 3 like this:
*firefox3c:\blah\firefox.exe
java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: org.openqa.selenium.server.browserlaunchers.InvalidBrowserExecutableException: The specified path to the browser executable is invalid.
原因:找不到FF,不能打開瀏覽器
解決:1、把ff重新安裝一次,安裝路徑默認,不要修改
2、在腳本中增加詳細的瀏覽器絕對路徑地址:
selenium = new DefaultSelenium("localhost", 4444, "*firefox D:\Program Files\Mozilla Firefox\firefox.exe","http://istock.jrj.com.cn/");