I am encountering difficulties when attempting to start Microsoft Edge in headless mode using JavaScript with Selenium

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!

Answer №1

It is recommended to configure the settings as shown below.

let config = new edge.Configuration(); 
config.setEdgeChromium(true); 
config.addArguments("headless"); 

Give it a try and see if it functions properly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing Express.js: Passing the req Object to Middleware without the Need for a New Multer Route

Hello to the Express.js and StackOverflow communities! I hope this question is not a duplicate, as I searched and found nothing similar. Currently, I am working on a project using Multer with Express to enable users to upload images, which will be saved a ...

Can Typescript classes be hoisted if I use two classes in my code?

Exploring Class Definitions Certain Rules to Comply With Ensuring that the class is defined in advance helps avoid errors. class Polygon { log() { console.log('i am polygon'); } } const p = new Polygon(); // Expected: no errors p.log(); U ...

Node.js: Managing and storing data efficiently

In the development of our messaging application in JavaScript using Node.js, we are focused on ensuring durability by storing text messages and media content outside of ejabberd. For text messages, we have opted for DynamoDB as a DB service. However, as we ...

Node.js Express route appears to be malfunctioning as a 404 error is being encountered,

I am encountering a 404 error when trying to make an axios post request to /users/add. Can anyone offer some guidance on what might be going wrong? Server.js app.use("/users", require("./routes/users")); This code snippet ensures that all user routes ar ...

Tips for adding a console.log statement to material-ui components to confirm the object/array/value

An issue arises in my React JS code snippet execution that I need help with: <TableBody> { (data.length > 0) ? ( data.map((x, i) => row( x, i, formColumns, handleRemove, handleSelect, editIdx ))) : (<TableRo ...

Dynamically add index to attribute as it updates

Having an issue with my dynamic button element: <button v-on:click="changeRecord(element)" v-b-modal.modal-5>Aendern</button> This button is generated dynamically within a v-for loop. Instead of manually including the attribute name like v-b- ...

Incorporate an image into a div element with the power of jQuery

As the user scrolls down the page, a sticky menu or floater bar appears. With the help of jQuery, I am able to apply the floater-bar class to the #menu-wrapper. My objective is to also insert an image inside an anchor tag at the same time the floater-bar ...

Understanding how to utilize jQuery or prototype to interpret onclick event containing "setLocation(...)" can enhance the functionality

I am dealing with a specific tag: <button onclick="setLocation('http://mysite.com/checkout/cart/add/product/17/')" /> My goal is to trigger an ajax request when the button is clicked. I want to extract the URL segment "product/17" and app ...

What could be causing the shake effect on the MUI dialog to not work when clicking away?

I am trying to implement a shake effect when the user clicks outside the MUI dialog to indicate that clicking away is not allowed. However, the code I have so far does not seem to be working as the effect is not being applied. Can someone please help me ...

What factors influence the improved speed of Jest when using the --maxWorkers=50% option?

Although not a universal truth, it appears that a majority of people (based on anecdotal evidence from conversations I've had) experience faster Jest runs when using --maxWorkers=50% or a similar setting, as opposed to leaving it unset or at 100%. Ch ...

Mac users using FireFox version 72.0.2 experiencing difficulties getting out of the "Remote Control" mode

Using version 72.0.2 (64-bit) on MacOS 10.14.6 (18G3020). Recently ran a Python Selenium script for automation and now Firefox still shows the orange stripes bar with an icon indicating "Browser is under remote control." Even after rebooting the machine, ...

Improving Performance in JavaScript by Altering Class Properties

I need to dynamically change the color properties of two classes, but my current code is sluggish since these classes are repeated over 100 times throughout the code. Any tips on optimizing this for better performance? if (mainColor) { var elColors = ...

The functionality of Protovis JavaScript is not supported within a dropdownlist's onchange event

I encountered an issue where one block of code works fine on its own, but when combined with another block, only one of them functions properly. The problem arises when I try to invoke a method from a dropdownlist using the onchange event, especially afte ...

Issue with "Maximum call stack.." error triggered by RequireJS version 2.1.9 in combination with Grunt

I've encountered an issue while using Grunt to construct a multi-module application (Backbone, Marionette, RequireJS, Handlebars). The error message "Error: RangeError: Maximum call stack size exceeded" keeps appearing. Interestingly, replacing the r. ...

What is the best way to pass an array to a JavaScript function from a different page?

My website has a static settings page where my JavaScript function uses AJAX to retrieve data from a MySQL table and display it in a table on an HTML document. It's working perfectly, gathering all the necessary data efficiently. Here's the code ...

Preventing Event Bubbling in Polymer 1.5 for iOS When Using iron-pages

Our single-page app utilizes iron pages and express-router for navigation. While it functions flawlessly on browsers and Android devices, we've encountered a bug when using iOS. The issue arises when switching pages by clicking a button. If the button ...

The jQuery script that is trying to create a fading effect on an image at intervals is encountering an error message

I am trying to cycle through 4 pictures every 3 seconds while fading them in and out. I have successfully changed the pictures, but when I attempt to use fadeOut, I encounter an error stating "Uncaught TypeError: $(...).fadeOut is not a function" in action ...

An unexpected error occurred during page generation. Any relevant console logs will be shown in the browser's terminal window

Encountered a RangeError: Maximum call stack size exceeded while compiling this web app in the browser. The error occurred on my header tag and sometimes on the return tag. What should I do? export default function Header() { return ( <> ...

Issue with Angular JS UI-Router Demo Implementation

Hey there! I'm new to JS and currently experimenting with a simple Angular ui-router example. However, I am encountering some issues with getting the router to work properly and I can't seem to figure out why. I've double-checked that both A ...

Guide to interpreting an Angular expression using traditional JavaScript conventions

I have encountered an issue with the Angular app that I am currently working on. It needs to retrieve the Google Analytics ID from Angular in order to pass it to ga('create', 'UA-XXXXX-Y') using standard JavaScript in my index.html. &l ...