zoukankan      html  css  js  c++  java
  • 启动Chrome浏览器弹出“You are using an unsupported command-line flag –ignore-certificate-errors. Stability and security will suffer”

    采用如下代码:

    public static void launchChrome() {
    		System.setProperty("webdriver.chrome.driver", "files/chromedriver.exe");
    		WebDriver driver = new ChromeDriver();
    		Navigation navigation = driver.navigate();
    		navigation.to("https://www.baidu.com");
    	}
    

    启动Chrome浏览器时弹出“You are using an unsupported command-line flag –ignore-certificate-errors. Stability and security will suffer”

    如下图:

    解决办法如下:

    public static void launchChrome() {
    		System.setProperty("webdriver.chrome.driver", "files/chromedriver.exe");
    		ChromeOptions options = new ChromeOptions();
    		options.addArguments("--test-type");
    		WebDriver driver = new ChromeDriver(options);
    		Navigation navigation = driver.navigate();
    		navigation.to("https://www.baidu.com");
    	}
    

     完美解决问题!!

  • 相关阅读:
    507.Perfect Number
    441.Arranging Coins
    344.Reverse String
    160.Intersection of Two Linked Lists
    HDU-2521 反素数
    HDU-2710 Max Factor
    HDU-2552 三足鼎立
    HDU-2549 壮志难酬
    HDU-2548 两军交锋
    HDU-2550 百步穿杨
  • 原文地址:https://www.cnblogs.com/yajing-zh/p/4902329.html
Copyright © 2011-2022 走看看