尝试以下 *** 作,更改路径并以符合您要求的方式大幅降低编码:-
WebDriver driver=null; System.setProperty("webdriver.chrome.driver","./src//lib//chromedriver"); DesiredCapabilities capabilities = DesiredCapabilities.chrome(); ChromeOptions options = new ChromeOptions(); options.addArguments("test-type"); options.addArgument("--start-maximized"); options.addArguments("--disable-web-security"); options.addArguments("--allow-running-insecure-content"); capabilities.setCapability("chrome.binary","./src//lib//chromedriver"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); driver = new ChromeDriver(capabilities); driver.get("https://www.google.com/");
以下是列出所有可用的chrome标志的链接:-
http://peter.sh/experiments/chromium-command-line-
switches/
希望它能对您有所帮助:)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)