Firefox 44.0.1 opening two tabs , when running selenium webdriver code

核能气质少年 提交于 2020-01-22 16:30:31

问题


My Firefox recently got updated recently. My firefox version is 44.0.1. When I run a simple code as below in selenium webdriver, two tabs are opening in firefox. How can i get rid of the unwanted tab. I changed Firefox setting, but still two tabs are opening. one tab is a plain tab and the second tab is https://support.skype.com/en/faq/FA34612/what-is-the-skype-extension. How can I load my URL that I want to automate in a single firefox window. Do I need to change any firefox setting.

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


    }
}

回答1:


Create a Firefox Profile and save it with name after making settings as per your requirement. Please call this profile in script.

Here is the steps to create firefox profile

Below is the script for example

 ProfilesIni profile = new ProfilesIni();

 FirefoxProfile myprofile = profile.getProfile("CreatedProfile");

 WebDriver driver = new FirefoxDriver(myprofile);

Thank You, Murali



来源:https://stackoverflow.com/questions/35293868/firefox-44-0-1-opening-two-tabs-when-running-selenium-webdriver-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!