Having trouble launching Edge in headless mode using JavaScript (mocha+ chai) with Selenium. It works fine in non-headless mode, but the snippet I'm using for headless mode doesn't seem to be working. Any suggestions on what I might be missing here? Can someone guide me on how to successfully launch Edge in headless mode? My current Edge version is 88.
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();
Thank you!