錯誤信息:
java.lang.RuntimeException: Could not start Selenium session: Failed to start new browser session: java.lang.RuntimeException: java.lang.RuntimeException: Firefox 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 like this:
*firefox c:\blah\firefox.exe

原因:找不到firefox(火狐不是默認安裝位置自己換了位置的),不能打開瀏覽器
解決方案:
方法一:設置環境變量,將火狐的地址放進path變量中
方法二:將火狐的路徑寫進來,注意路徑的\要用\\,其中一個\是轉義的意思
即下面的"*firefox"改為 "*firefox D:\\study\\selenium\\Firefox\\firefox.exe"