【WebDriver】启动chrome浏览器并全屏

来源:互联网 发布:懒懒淘宝客助手官网 编辑:程序博客网 时间:2024/04/25 20:37

通过设置chrome的属性实现。


System.setProperty("webdriver.chrome.driver", driverDir);ChromeOptions options = new ChromeOptions();        List<String> op = new ArrayList<String>();        op.add("start-fullscreen");        op.add("allow-running-insecure-content");        op.add("--test-type");        options.addArguments(op);driver = new ChromeDriver(options);driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);


0 0
原创粉丝点击