I am not able to launch the ms edge in headless mode from js selenium

Ratnalarao Perugu 21 Reputation points

Hi Team ,

i am not able to launch the edge in headless mode in js (mocha+ chai) selenium . I am able to launch in non headless mode and it is working as expected . PFB snippet which i am using to launch in headless mode . Am i missing anything here ? Could you please help me out here to launch in headless mode . 88 is my edge version.

edge = require('selenium-webdriver/edge');
headLessMode = true ;
driver = headLessMode ? new webdriver.Builder().withCapabilities(webdriver.Capabilities.edge()).
setEdgeOptions(new edge.Options().addArguments(['--headless','--no-sandbox','--start-maximized','--window-size=1900,1080'])).build() :
new webdriver.Builder().withCapabilities(webdriver.Capabilities.edge()).build();

Thanks ....

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
1,923 questions
{count} votes

Accepted answer
  1. Deepak-MSFT 2,186 Reputation points Microsoft Vendor

    @Ratnalarao Perugu ,
    I suggest you try to set the options like below.

    let options = new edge.Options();   

    See whether it works.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful