Selenium webdriver 无法使用给定的url连接firefox驱动程序
我已经编写了以下代码。 但是每当我要运行代码时,就会产生一些错误,下面给出了生成的错误Selenium webdriver 无法使用给定的url连接firefox驱动程序,selenium-webdriver,automated-tests,ui-automation,selenium-firefoxdriver,Selenium Webdriver,Automated Tests,Ui Automation,Selenium Firefoxdriver,我已经编写了以下代码。 但是每当我要运行代码时,就会产生一些错误,下面给出了生成的错误 ***package techAltum; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.W
***package techAltum;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class JabongSearchBox {
WebDriver driver;
String url;
@Before
public void launchBrowser(){
//Open Browser
/*i am getting error at driver= new FirefoxDriver(). browser open but didn't get url.*/
**driver = new FirefoxDriver();
driver.manage().window().maximize();
url = "http://www.jabong.com";**
driver.get(url);
}
@Test
@After
public void quitBrowser(){
driver.quit();
}
}***
如果您使用selenium 2.48.2,firefox在最近一周的更新中似乎有所改变。我有一个使用selenium的应用程序,现在在最新的firefox中也失败了
我曾经说过,通常selenium的家伙们迟早会发布一个新版本来支持它,希望这能解决问题,只需像这样初始化你的
webdriver
:
WebDriver driver = null;
这段代码适合我,我使用的是selenium 2.48.2和Firefox 43.0.2。请验证您正在使用最新的selenium和Firefox。
如果您再次面临问题,请发布错误消息,这将使我们更好地了解您的问题 目前我正在使用这两个版本的最新版本。我的所有工作区程序也会像new一样给出相同的错误(以前我运行得很好)。我检查了chrome、firefox和IE,也发现了同样的问题:浏览器打开,但没有得到url,程序终止。我有一个问题,类似于两周前的charm,在firefox的更新破坏了它之后,我假设通信API从selenium更改为firefox。我想我们应该等待selenium的更新