首页 文章

使用selenium web驱动程序时在firefox中加载站点

提问于
浏览
-1

我的默认浏览器是firefox . 但是当我尝试使用selenium web驱动程序加载文件时,它会自动通过谷歌Chrome加载 . 如何将其更改为Firefox? Eclipse首选项也设置为默认浏览器 .

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");
}}

1 回答

  • 1

    请用以下方法获取网址:

    driver.getUrl("Your host link");
    

相关问题