Commit c63f52e7 authored by YuShijiaCode's avatar YuShijiaCode

headless

parent 6453b949
......@@ -13,8 +13,8 @@ exports.getDriver = function (webdriver, browser) {
switch (browser) {
case 'chrome':
let chrome = require('selenium-webdriver/chrome');
let chromedriver = require('./Driver/chromedriver');
// let chromedriver = require('./Driver/chromeDiver_linux');
// let chromedriver = require('./Driver/chromedriver');
let chromedriver = require('./Driver/chromeDiver_linux');
// let chromedriver = require('chromedriver');
// if(chrome.getDefaultService().isRunning()){
// chrome.getDefaultService().kill();
......@@ -31,9 +31,9 @@ exports.getDriver = function (webdriver, browser) {
.withCapabilities(chromeCapabilities)
.setChromeService(service)
// Not use headless
.setChromeOptions(new chrome.Options().addArguments('--no-sandbox',"excludeSwitches=['enable-automation']"))
// .setChromeOptions(new chrome.Options().addArguments('--no-sandbox',"excludeSwitches=['enable-automation']"))
// Use headless
// .setChromeOptions(new chrome.Options().addArguments("--headless",'--ignore-certificate-errors','window-size=1920,1080','--no-sandbox',"excludeSwitches=['enable-automation']"))
.setChromeOptions(new chrome.Options().addArguments("--headless",'--ignore-certificate-errors','window-size=1920,1080','--no-sandbox',"excludeSwitches=['enable-automation']"))
.build();
break;
case 'firefox':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment