Java 使用selenium web驱动程序时在firefox中加载站点
我的默认浏览器是firefox。但当我尝试使用SeleniumWeb驱动程序加载文件时,它会通过GoogleChrome自动加载。如何将其更改为firefox?Eclipse首选项也已设置为默认浏览器Java 使用selenium web驱动程序时在firefox中加载站点,java,eclipse,selenium,selenium-webdriver,Java,Eclipse,Selenium,Selenium Webdriver,我的默认浏览器是firefox。但当我尝试使用SeleniumWeb驱动程序加载文件时,它会通过GoogleChrome自动加载。如何将其更改为firefox?Eclipse首选项也已设置为默认浏览器 package com.selenium.example; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebEle
package com.selenium.example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class ExampleSelenium {
public static void main(String[] args) {
FirefoxDriver driver = new FirefoxDriver();
driver.get("http://localhost:3030/fuseki.html");
}}
请使用以下方法获取URL:
driver.getUrl("Your host link");
如果编写此FirefoxDriver=new FirefoxDriver();然后它必须在firefox中打开。@HelpingHands没有发生。这就是我的问题所在。它总是通过谷歌浏览器加载。我已经改变了谷歌浏览器中的代理设置。因此,它不支持本地主机。所以我想通过firefox加载localhost。如果使用其他URL怎么办?而不是本地主机?比如google.com?这在firefox中是打开的吗?@HelpingHands是的。然后我想是它的localhost问题..尝试使用方法driver.Navigate().GoToURL()