Using Chrome with Selenium WebDriver in JavaScript (webdriver.js)

I have been using Selenium Webdriver with Chromium and everything works perfectly. However, when I try to switch to Chrome (which I prefer because it supports headless mode in the latest version), I encounter a problem where Chrome fails to start up properly.

Error message: WebDriverError: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.29.461571 (8a88bbe0775e2a23afda0ceaf2ef7ee74e822cc5),platform=Linux 4.2.8.11-1-MANJARO x86_64)

var selenium = require ('selenium-webdriver'),
By = selenium.By,
until = selenium.until,
Select = selenium.Select;

var chrome = require ("selenium-webdriver/chrome");
var o = new chrome.Options();

o.setChromeBinaryPath( "/opt/google/chrome-unstable/");

var service = new chrome.ServiceBuilder()
    .loggingTo('/tmp/chromescraper.txt')
    .enableVerboseLogging()
    .build();

var driver = chrome.Driver.createSession(o, service);

 driver.get ("http://news.google.com");

Has anyone encountered this issue before? Any suggestions on how to resolve it?

Answer №1

Encountered the same issue and discovered that each ChromeDriver is specifically designed to support certain versions of Chrome binary. If there is a mismatch between the two, problems may arise. For instance, as of now, the latest ChromeDriver version 2.33 is compatible with Chrome versions 60-62. To find out which Chrome version your ChromeDriver supports, visit the link below. Best of luck!

https://sites.google.com/a/chromium.org/chromedriver/downloads

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

What is the best way to pass a variable using the href tag in jQuery?

for (var i in result) { $('#tgt').append( "<li><a href='/UpdateStatusData/?id='"+result[i]+" >"+result[i]+"</a></li>"); } I am facing an issue where the id is appearing blank when being extracted o ...

Is there a standard event triggered upon the closing of a browser tab or window?

Does React have a built-in event that is triggered when a browser tab or window is closed? If it does, does it have support across different browsers? ...

The source property in the Nextjs Image tag is not valid

<Image src={"http://localhost:3000/images/img.jpeg"} layout="fill" objectFit="cover" width={"100%"} height={"100%"} /> An error message has appeared: https://i.sstatic.net/jI9mh.png Any s ...

Plugin that collapses dropdown menus when the mouse hovers over them, powered by jQuery

My webpage has a simple set of links, and one of them triggers a dropdown menu to appear on mouseover (refer to the image below). The dropdown submenu becomes visible when the link "How fast is it?" is hovered over, and remains fixed in place due to the di ...

Using C# with Protractor to Locate an Element Inside Another Element

In my testing of an AngularJS app, I have encountered HTML code that resembles the following: <div class="ng-scope" ng-repeat="something in section.questions"> ... </div> <div class="ng-scope" ng-repeat="something in section.questions"> ...

Which specific event in NextJS is triggered only during the initial load?

I am working on a NextJS app and I want to implement an initial loading screen that only appears during the first load. Currently, the loading screen pops up not only on the initial load but also whenever a link is clicked that directs the user back to the ...

Utilizing Python and Selenium to Implement Following-sibling in XPath

I'm struggling to locate the xpath for clicking on the "Open" button aligned with the text "front", both of which are highlighted in green in the image. Can anyone help me with this? https://i.sstatic.net/SskJ0.jpg ...

Utilizing React JS to dynamically populate a table with data from an external JSON file

As a newcomer to the realm of React, I am facing challenges in displaying my JSON data in a table. class GetUnassignedUsers extends React.Component { constructor () { super(); this.state = { data:[] }; } com ...

Uncertain about the request path that is being transmitted to my Express server via AJAX

I have a simple Node.js Express server setup My goal is to serve html files by using res.sendFile with this route handler: router.get('/:run_id/:test_num',function(req,res,next){ var runId = req.params.run_id; var testNum = req.params. ...

What is the best way to break a single line into multiple lines when working in VS code?

I have written the following code in nodeJS.. async function GetSellerInfoByID({seller_user_id}) { console.debug("Method : GetSellerInfoByID @user.service.js Calling..."); await clientDB.connect(); dataBaseData = await clientDB. ...

The link does not respond to the first click

I'm having an issue with the search feature on my website. The page includes an auto-focused text input element. As the user types, an ajax request is made and JQuery fills a div with search results. Each result is represented by an <li> elemen ...

Contrast between the $q constructor and promise interface

Can you explain the concept of a promise interface in angular JS? Furthermore, what exactly is a $q constructor? In which scenarios are these functionalities utilized and how do they differ from each other? I have looked into multiple resources but st ...

What is the best way to determine if a string includes values from an array?

After taking a brief hiatus from coding, I'm diving back in and working on a userscript for a Facebook game. The script will gather data from all game-related posts and use that information to kickstart the accepting process. Currently, I'm stru ...

The hyperlink does not function properly when included within an <input type=button> element

I have encountered an issue with the code below. In my project, I have a search bar along with some buttons. Currently, only the hyperlink of the search button is functioning correctly. The other buttons seem to redirect to the same link as the search bu ...

"Enhance your browsing experience with a java-powered Browser

Are there possible methods to develop a Chrome / Chromium extension using Java? I attempted to use selenium for this purpose, but it seems limited to browser automation and unable to capture user events. If not feasible with Chrome/Chromium, are there oth ...

Mapping this particular array of objects to an array grouped by the shared key value requires a specific process. Let's explore how

Looking to transform this simplified array of objects: var items = [{"function":"function_1","process":"process_1"}, {"function":"function_1","process":"process_2"}, {"fun ...

Populating a drop-down menu with data from a JSON file using dat.gui

I am currently working on a drop-down menu using JavaScript. Below is the content of my JSON file: { "bg1":"assets/bg/people_bg.jpg", "bg2":"assets/bg/people_bg.jpg" } My goal is to assign the names bg1 and bg2 to the backgrounds in the dropdown menu, ...

When you try to create a popover, a cautionary message pops up indicating that $tooltip is no longer supported. It is

I need help with creating a popover that appears when hovering over an anchor tag. Here is the code I am using: angular: 1.4.2 ui-bootstrap :0.14.2 <div class="row" ng-repeat="endorsement in endorsements| filter: {category:categorySelected}"> &l ...

When the `back` button is clicked in a browser from a different domain, does it trigger a page reload?

Imagine a scenario where a user accesses mydomain.com. At this point, the history stack contains only one entry. Then, the user clicks on a link within my website that leads to mydomain.com/cool, causing another state to be pushed onto the stack. Now, with ...

Set the minimum height of a section in jQuery to be equal to the height of

My goal is to dynamically set the minimum height of each section to match the height of the window. Here is my current implementation... HTML <section id="hero"> </section> <section id="services"> </section> <section id="wo ...