Firefox 44.0.1打开两个标签,运行selenium webdriver代码时 [英] Firefox 44.0.1 opening two tabs , when running selenium webdriver code
问题描述
import org.openqa.selenium.WebDriver;
导入org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
$ b $ public class Another {
@Test $ b $ public void tester(){
WebDriver driver = new FirefoxDriver();
driver.manage()。window()。maximize();
driver.get(http://jqueryui.com/datepicker/);
$ b 解决方案创建一个Firefox配置文件并根据您的要求进行设置后将其保存为名称。请在脚本中调用此配置文件。
这里是创建firefox配置文件的步骤
以下是脚本例子
ProfilesIni profile = new ProfilesIni();
FirefoxProfile myprofile = profile.getProfile(CreatedProfile);
WebDriver driver = new FirefoxDriver(myprofile);
谢谢,
Murali
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/");
}
}
解决方案 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
这篇关于Firefox 44.0.1打开两个标签,运行selenium webdriver代码时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!