Skip to content

Commit

Permalink
replace setDefaultService function in chrome #1356
Browse files Browse the repository at this point in the history
  • Loading branch information
shunguoy committed Apr 25, 2023
1 parent 37019fd commit b62dd12
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function getBrowserChrome() {
let service = new chrome.ServiceBuilder(spath).build();
// setDefaultService function is removed since web-driver v4.3.1+
//chrome.setDefaultService(service);
chrome.Driver.createSession(new chrome.Options(), service);
chrome.Driver.createSession(options, service);

return new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ beforeAll(function() {
const service = new chrome.ServiceBuilder(spath).build();
// setDefaultService function is removed since web-driver v4.3.1+
//chrome.setDefaultService(service);
chrome.Driver.createSession(new chrome.Options(), service);
chrome.Driver.createSession(options, service);

browser = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ before(function(done) {

// setDefaultService function is removed since web-driver v4.3.1+
//chrome.setDefaultService(service);
chrome.Driver.createSession(new chrome.Options(), service);
chrome.Driver.createSession(options, service);

browser = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,15 @@ if (userBrowser.toUpperCase() === "FIREFOX") {
spath = require('chromedriver').path;
}
var service = new chrome.ServiceBuilder(spath).build();
// setDefaultService function is removed since web-driver v4.3.1+
//chrome.setDefaultService(service);
chrome.Driver.createSession(new chrome.Options(), service);


const options = new chrome.Options();
options.addArguments("--disable-dev-shm-usage");
options.addArguments("--headless");
options.addArguments('--ignore-certificate-errors')

// setDefaultService function is removed since web-driver v4.3.1+
//chrome.setDefaultService(service);
chrome.Driver.createSession(options, service);

browser = new webdriver.Builder()
.withCapabilities(webdriver.Capabilities.chrome())
Expand Down

0 comments on commit b62dd12

Please sign in to comment.