Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Javascript : how to set "setExperimentalOption" for chrome

Getting "options.setExperimentalOption is not a function" error message when using setExperimentalOption.

var chrome = require("selenium-webdriver/chrome");
        let options = await new chrome.Options();
        options.setExperimentalOption("excludeSwitches",Arrays.asList("disable-popup-blocking","enable-automation")); 
        options.addArguments("--disable-dev-shm-usage");
        options.addArguments('--ignore-certificate-errors');
        options.addArguments('--ignore-ssl-errors');
        
        driver = await chrome.Driver.createSession(options);  

Kindly help.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

For Selenium 4, based on this api-docs, there is excludeSwitches method for corresponding experimental option.

var chrome = require("selenium-webdriver/chrome");
let options = await new chrome.Options();
options.excludeSwitches("disable-popup-blocking", "enable-automation"); 
options.addArguments("--disable-dev-shm-usage");
options.addArguments('--ignore-certificate-errors');
options.addArguments('--ignore-ssl-errors');

driver = await chrome.Driver.createSession(options); 

And there is a list of methods for other options:

this.headless() → Options
this.setChromeBinaryPath( path ) → Options
this.setChromeLogFile( path ) → Options
this.setChromeMinidumpPath( path ) → Options
this.setLocalState( state ) → Options
this.setMobileEmulation( config ) → Options
this.setPerfLoggingPrefs( prefs ) → Options
this.setUserPreferences( prefs ) → Options
this.windowSize( size ) → Options
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!