Nitesh Srivastava
Nitesh Srivastava

Reputation: 1

Selenium java script suddenly very slow on my mac chrome browser

I have a TestNG framework of Selenium using Java. I am using it on my macbook (Chip Apple M1).

Last week till Wednesday my scripts were working fine. When i started to work on Thursday i suddenly realised the scripts are very slow. Due to slowness its getting failed in between as well.

Java Version:

openjdk version "11.0.22" 2024-01-16
OpenJDK Runtime Environment Homebrew (build 11.0.22+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.22+0, mixed mode)

Selenium dependency version:

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.19.1</version>
</dependency>

Chrome Version:

Version 124.0.6367.62 (Official Build) (arm64)

For my script i also need a chrome extension Multipass. This extension i am enabling through chrome options. Below is my code of chrome options.

ChromeOptions options = new ChromeOptions();
options.addArguments("--remote-debugging-port=9225");
options.addArguments("--remote-allow-origins=*");
options.addArguments("--hide-crash-restore-bubble");
options.addArguments("--user-data-dir=/Users/nitesh/Library/Application Support/Google/Chrome");
options.addExtensions(new File(System.getProperty("user.dir") + "/src/test/resources/Extension/MultiPass.crx"));
driver = new ChromeDriver(options);

I am not passing chrome driver into my script. As i understood in the latest selenium version we don't need to pass it.

I uninstalled chrome. Then installed again.

Also, i tried adding manually chromedriver into the script. However, on the website https://googlechromelabs.github.io/chrome-for-testing/ i don't see chrome driver for browser version 124.

I want help regarding this. How should i solve this issue?

Is this issue of latest chrome browser or chrome driver or java version or macbook or selenium version. Please help.

Upvotes: 0

Views: 604

Answers (3)

Nitesh Srivastava
Nitesh Srivastava

Reputation: 1

Finally my issue is resolved. Somehow, my IntelliJ was using Java 17 Corretto.

I changed the configuration of IntelliJ. Now it uses java 11 and the script works fine.

Upvotes: 0

techexcel
techexcel

Reputation: 1

"The same issue persists in Laravel Dusk; Chrome is consuming 100% of the memory.

I have uninstall the chrome and then also same issue persists

but worked when we used 120.0.0.61 version of code

Upvotes: 0

Zvjezdan Veselinovic
Zvjezdan Veselinovic

Reputation: 547

You need to change your chrome driver and the selenium webdriver version to the old version inside of: https://googlechromelabs.github.io/chrome-for-testing/

I think that Google did some kind of update and it broke their Chrome Driver. So, this, in turn, caused a lot of automation to fail over the weekend ( my company is experiencing this now ).

So, lowering the version to the previous one should help out. Also, if you have NuGet or whichever Package Manager you have for Java, you should update the Chrome Driver package to version 124.

I did this and my automation is working.

Upvotes: 0

Related Questions