![](/img/trans.png)
[英]Unable to Launch Chrome and Firefox using selenium webdriver
[英]Unable to launch firefox browser in selenium webdriver
package newpackage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class webdriver {
public static void main(String[] args){
//System.setProperty("webdriver.gecko.driver", "C:\\Users\\Akash\\Downloads\\geckodriver-v0.18.0-win64\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://google.com");
}
}
出現以下錯誤:
線程“主”中的異常org.openqa.selenium.WebDriverException:org.apache.http.conn.HttpHostConnectException:連接到localhost:18820 [localhost / 127.0.0.1,localhost / 0:0:0:0:0:0: 0:1]:失敗:連接被拒絕:連接構建信息:版本:“未知”,修訂版:“未知”,時間:“未知”
請嘗試一下
希望這可以幫助。 謝謝。
當您使用更新的壁虎時更新硒罐文件可能會解決您的問題
如我所見,您評論了setProperty方法,然后確保您使用的是低於2.53的jar和低於47的ff版本。
否則,如果您在此之上使用了jars,則必須使用更新的gecko驅動程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.