【问题标题】:Firefox 44.0.1 opening two tabs , when running selenium webdriver codeFirefox 44.0.1 在运行 selenium webdriver 代码时打开两个选项卡
【发布时间】:2016-02-09 13:55:09
【问题描述】:

我的 Firefox 最近更新了。我的 Firefox 版本是 44.0.1。当我在 selenium webdriver 中运行如下简单代码时,Firefox 中打开了两个选项卡。我怎样才能摆脱不需要的标签。我更改了 Firefox 设置,但仍然打开了两个选项卡。一个标签是普通标签,第二个标签是https://support.skype.com/en/faq/FA34612/what-is-the-skype-extension。如何在单个 Firefox 窗口中加载我想要自动化的 URL。我需要更改任何 Firefox 设置吗?

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;    
import org.testng.annotations.Test;

public class Another {
    @Test
    public void tester(){
        WebDriver driver = new FirefoxDriver();
    driver.manage().window().maximize();
    driver.get("http://jqueryui.com/datepicker/");


    }
}

【问题讨论】:

    标签: firefox selenium-webdriver


    【解决方案1】:

    根据您的要求进行设置后,创建一个 Firefox 配置文件并使用名称保存。请在脚本中调用此配置文件。

    Here是创建firefox配置文件的步骤

    下面是脚本示例

     ProfilesIni profile = new ProfilesIni();
    
     FirefoxProfile myprofile = profile.getProfile("CreatedProfile");
    
     WebDriver driver = new FirefoxDriver(myprofile);
    

    谢谢你, 壁画

    【讨论】:

    • 是firefox新版本的问题吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-18
    • 2018-01-03
    • 1970-01-01
    相关资源
    最近更新 更多