Having trouble initiating Chrome browser with Selenium 4.0.0 and ChromeDriver in conjunction with Java 16.0.1

Ever since upgrading Selenium to 4.0.0, I've been encountering issues with opening Chrome and Firefox browsers. Here are the specifics: Chrome : Version 96
Chrome driver : Updated to support version 96. Downloaded from this link
Selenium : 4.0.0

This is the code snippet used to initiate the browser:

 System.setProperty("webdriver.chrome.driver", "<location of chromedriver>");<br>
    driver = new ChromeDriver();

The browser window opens briefly before closing abruptly. A corresponding error message is:

AILED CONFIGURATION: @BeforeClass beforeClassSetup("chrome")
org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Possible causes may include an invalid server address or browser startup failure.
Build info: version: '4.0.0', revision: '3a21814679'
System info: host: 'dkleinman.esri.com', ip: 'fe80:0:0:0:23:8798:b33c:2bf6%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '16.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}], desiredCapabilities=Capabilities {browserName: chrome, goog:chromeOptions: {args: [], extensions: []}}}]

Switching back to Selenium 3.14 (while keeping Chrome at version 96) resolves this issue smoothly.

Answer №1

It seems there could be a compatibility issue between Selenium and Java 16 based on this Stack Overflow thread

One potential solution might involve replacing java.version: '16.0.1' with the latest stable version of JDK 8u311

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

Python Selenium - Chrome window does not respond to button clicks

When attempting to click the submit button in a window opened by the Chrome driver (even manually in the controlled window while running automated tests with pytest selenium-python), it does not register the click. Interestingly, there is no issue with th ...

My DOM contains two elements that have been identified by xpath: one is clickable while the other is not. I am trying to determine a way to identify which element is clickable using

When dealing with duplicate elements loading in the DOM, I am faced with the challenge of needing to click on a clickable element while avoiding clicking on an element that is not clickable. Using wait statements has proven ineffective in this situation. ...

Tap the JavaScript hyperlink containing the onclick event attribute

I've put in a considerable amount of effort trying to resolve an issue with a link that contains an onclick attribute, but unfortunately, I haven't been able to make any progress. Here is the HTML code for such an element: <a href="javasc ...

Using Selenium to operate the Edge browser on MacOs Catalina

Seeking assistance in running this code on Python & MacOS (Catalina) I have successfully used it in a Windows environment as expected, but I am encountering difficulties while trying to run it on Mac. It seems that some configuration adjustments are requi ...

How to use Python Selenium to click on an icon located beside specific text

In the code snippet below, I am attempting to click on the second trash icon button located next to Test1. <tr class=“ng-scope”> <td class=“ng-scope”></td> <td class=“ng-scope”></td> <td class=“ng-scope ...

Ways to choose an item with a value above zero

Seeking to locate an element with a data-stock value higher than 0. The following code is useful for finding elements with specific stock values: findElement(By.xpath("//div[@data-stock='2']) However, as the stock is constantly changing, I ...

Automate the selection of dropdown values in a Selenium script based on user input received from the console

I need help selecting a specific value from a drop-down menu after an image (Stripe.com) has been added and a user input is passed through the console. Currently, my code is only comparing zero values from the drop-down with the user input. Here is the co ...

Is there a way to execute selenium scripts on a virtual machine without relying on Selenium Grid?

I am able to run my script on a local machine, but now I need to run a Selenium script from my local machine to a Virtual Machine. I have already tried using Selenium Grid and Jenkins, but unfortunately our system has certain restrictions. Are there any ...

What is the best way to select an item from a dynamic dropdown menu?

I am trying to automate a test using Selenium in Java, but I'm facing difficulty selecting the "CORAL" server from a dropdown list. Here is the HTML code snippet for the dropdown: <div id="listBoxjqxWidgetHostPortCombo" style="overflow: hidden; ...

Uh oh, JMeterThread encountered an issue: Test failed due to org.openqa.selenium.WebDriverException - driver server took too long to start

My current setup involves using chromedriverVersion: 83.0.4103.39 and Chrome version =83.0.4103.97 for efficient execution on Jmeter. However, after a few hours of testing, I encounter an error message stating "ERROR o.a.j.t.JMeterThread: Test failed! or ...

"Can someone please guide me on how to select a particular category element from a list using Selenium

from selenium import webdriver import time from selenium.common.exceptions import NoSuchElementException driver = webdriver.Chrome("C:/Users/ysatish/PycharmProjects/all rules/driver/chromedriver.exe") driver.maximize_window() driver. ...

Unexpected appearance of a blue line in Material UI when the overflow attribute is included

For my React application, I've integrated Material-UI along with styled components. The strange thing is that when I use a Chrome browser to view the app, I encounter an issue that doesn't seem to happen in Firefox. The problem arises when I add ...

Ways to terminate the browser session (chrome) that was launched by the web driver earlier

I need help with terminating the browser window (Chrome) that was previously opened by the web driver. My goal is to only have one instance of the browser open at a time, so I want to close the existing one every time I run my program and then open a new i ...

Utilizing a Custom Chrome Profile with Selenium

My attempt to use Selenium with my default Chrome Profile is failing, and I can't seem to find a solution. I've tried using both Profile 1 and the Default profile but encountered the same error message shown below. Despite ensuring that all Chrom ...

After the automation is finished, I am interested in outputting the IMDB rating of a movie or series to the terminal

I prefer using Google search to find the element because I find it easier to navigate compared to IMDB. import selenium.webdriver as webdriver print("This script is designed to retrieve the IMDb rating of a movie or TV series!!!") def get_results(search_ ...

Using the combination of Selenium, C#, and Chrome WebDriver can lead to Content Security Policy (CSP

I have a console application using Selenium in C# with the Chrome webdriver. When I run it without the headless option, no CSP warnings appear in the console window. However, when running with the headless option, I encounter the following message repeat ...

When using Python's Selenium4 ChromeDriver in non-headless mode, it crashes and throws a `SessionNotCreatedException` (it works fine in headless mode)

I've encountered an issue with my Python Selenium4 script using ChromeDriver that refuses to start in non-headless mode: Interestingly, I have other scripts with the same imports that don't crash. Traceback (most recent call last): File " ...

Is it possible to extract the href generated by JavaScript when clicking a button using selenium?

Currently, I am utilizing selenium to extract automated phone reporting data from our Barracuda Cudatel phone system. While the system lacks an API that provides the necessary information, there is a button on the report page with attached JavaScript that ...

Is it possible to encounter rate limiting when using Selenium for web scraping on various websites?

I understand that there are restrictions on sending GET requests to websites, but I'm curious if these limits also apply to Selenium. Is it possible to get restricted for using Selenium? For instance, take a look at this code snippet: from selenium i ...

Information inputted through Selenium webdriver's sendKeys() function fails to be recognized

My current project involves automating a user journey on an insurance web application. The process includes interacting with two fields that are populated based on a hidden list of matching selections. As the user begins typing, a list of options appears f ...