簡體   English   中英

找不到Selenium Webdriver和Firefox Server錯誤

[英]Selenium Webdriver and Firefox Server Not Found error

我正在使用Win 7 64,Selenium IDE 2.5.0,WebDriver 2.42和Eclipse Kepler SR2。 我正在嘗試使用driver.get啟動瀏覽器,但是無論我輸入什么URL,我都會打開瀏覽器,但出現“找不到服務器”錯誤。 這讓我發瘋。 似乎它打開了Firefox的一個實例,該實例看起來不像我用來瀏覽Internet的Firefox,它沒有我的書簽和附件,也沒有連接到Internet。 有什么幫助嗎? 謝謝。

這是我正在使用的代碼:

package com.packt.webdriver.chapter1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa
public class NavigateToAUrl {
    public static void main (String[] args) {
        WebDriver driver = new FirefoxDriver () ;
        driver.get("https://www.google.com");
    }

}

嘗試以下代碼:

System.setProperty("webdriver.firefox.profile", "default");
FirefoxDriver driver = new FirefoxDriver();
driver.get("http://google.com/");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM