SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
L

42

191

I am currently new to robot framework.I am currently using latest window version of chrome and chromedriver which is 80 but when i try to run the test it gives the message "SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81" in pycharm but currently beta version of 81 is only available. I have tried uninstalling everthing and reinstalling it again but nothing works can anyone help me with this.Thank you!

Screenshots below: 1

2

Lumberyard answered 19/2, 2020 at 9:24 Comment(6)
Why don't you use version 81? It won't work with version 80.Inexistent
only beta version available and it is not supporting it.Lumberyard
Same issue running E2E tests in selenium (Angular 8.2.x) (Driver info: chromedriver=81.0.4044.20 (f006328e39a9769596eb506c8841c3004b24e747-refs/branch-heads/4044@{#244}),platform=Windows NT 10.0.18362 x86_64) at Object.checkLegacyResponse (..\node_modules\selenium-webdriver\lib\error.js:546:15) at parseHttpResponse (..\node_modules\selenium-webdriver\lib\http.js:509:13) at ..\node_modules\selenium-webdriver\lib\http.js:441:30 at processTicksAndRejections (internal/process/task_queues.js:94:5) [08:54:47] E/launcher - Process exited with error code 100Trattoria
In my case all I had to do was open my normal chrome browser, go to menu Help -> About Google Chrome and then it started updating chrome to the latest version (I had 81 and updated to 83). Restarted chrome and when I reran the chromedriver it worked.Delozier
You need to simply update ChromeDriver. I wrote an easy article on medium for it.Crotch
Does this answer your question? Error message: "'chromedriver' executable needs to be available in the path"Pommard
T
287

I solved these kinds of problems using the webdrive manager.

You can automatically use the correct chromedriver by using the webdrive-manager. Install the webdrive-manager:

pip install webdriver-manager

Then use the driver in python as follows

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager().install())

This answer is taken from https://stackoverflow.com/a/52878725

Transpontine answered 24/4, 2020 at 15:35 Comment(7)
Thanks, @dylanvanw, while need to download the image everytime?Chastitychasuble
@EspoirMurhabazi you don't need to download the image every time. There is a caching mechanism in in webdriver_manager so if possible it will use the correct driver on your machine that the webdriver_manager downloaded in a previous run.Transpontine
Didn't work for me. I think this won't work unless the path is correct.Crotch
@Crotch the nice thing about this solution is that you do not have to provide a path yourself. What about this solution did not work for you?Transpontine
For people on C#, the solution is the same, just use the webdriver-manager Nuget package. See their Readme for usage.Agglomerate
In case you get this error: ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_117.0.5938. This solved the problem for me: https://mcmap.net/q/67234/-valueerror-there-is-no-such-driver-by-urlCantle
As of Feb 2024, Selenium (I have 4.17.2) automatically downloads the latest chromedriver to run on my windows machine. I don't need webdriver-manager.Benuecongo
R
49

I got the same message on MacOS:

"selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81"

Then I run this command, it's gone:

# Homebrew 3
brew upgrade chromedriver

# Homebrew < 3
brew cask upgrade chromedriver
Rotow answered 27/5, 2020 at 6:53 Comment(2)
For homebrew 3, just brew upgrade chromedriver.Heptamerous
This fixed the error in my Ruby framework as well :)Vegetable
L
48

Do below steps :

  1. Check the version of chrome browser.

  2. download chromedriver of same version from https://sites.google.com/chromium.org/driver/home

  3. Give correct path in the pycharm and run the code.

Lala answered 31/5, 2020 at 19:50 Comment(2)
Worked fine to me. I found the correct path into the error message itself and replaced the file with the one I just downloaded. Hope this helps tooBeforehand
How do you find the correct path? Edit: I figured the path out. On mac, cmd+shift+g then /usr/local/binSetiform
S
13

This error message...

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81

...implies that the ChromeDriver v81 was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser where is version is other then 81.0.


Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You mentioned about using chromedriver=80 and chrome=80 but somehow while your program execution ChromeDriver v 81.0 is used.
  • So, it's quite evident your have chromedriver=81.0 present within your system and is present within the system PATH variable which gets invoked while you:

    driver = webdriver.Chrome()
    

Solution

There are two solutions:

  • Either you upgrade chrome to Chrome Version 81.0 level. (as per ChromeDriver v81.0 release notes)
  • Or you can override the default chromedriver v81.0 binary location with chromedriver v80.0 binary location as follows:

    from selenium import webdriver
    
    driver = webdriver.Chrome(executable_path=r'C:\path\to\chromedriver.exe')
    driver.get('http://google.com/')
    

Reference

You can find a couple of relevant discussions in:

Strephon answered 19/2, 2020 at 12:49 Comment(3)
Thanks for your response @debanjan. Also I tried with firefox browser by installing and adding path of geckodriverLumberyard
How do we get the path?Crotch
executable_path seems to do nothing. My /usr/local/bin/chromedriver --version matches the exact version it's looking for and it still complains that the version doesn't match.Jefferey
C
10

this works for me

brew cask upgrade chromedriver

Above is deprecated on MacOs, use: brew install chromedriver (if not already installed) brew upgrade chromedriver

Crystlecs answered 1/9, 2020 at 9:17 Comment(1)
Brew is by default available in MacOs. You have to install it in WindowsExperientialism
C
6

Go to your Chrome settings -> About Chrome -> Check version and download chromedriver from Below according to your Chrome version https://chromedriver.chromium.org/downloads

Citronellal answered 30/5, 2020 at 7:14 Comment(0)
A
6
  1. First of all check latest Chrome version (This is your browser Chrome version) link

  2. Download same version of Chrome Web Driver from this link

Do not download latest Chrome Web Driver if it does not match your Chrome Browser version.

Note: When I write this message, latest Chrome Browser version is 84 but latest Chrome Driver version is 85. I am using Chrome Driver version 84 so that Chrome Driver and Chrome Browser versions are the same.

Aronow answered 6/8, 2020 at 9:28 Comment(0)
F
6

The solution (at least on OSX) is:

  1. Download the latest chromedriver file.
  2. Unzip the downloaded file.
  3. Search the location of the old chromedriver file on your computer and replace it with the new chromedriver file.
  4. Right-click the chromedriver file and click open. Do not double click as Mac will not open it the proper way.
  5. Once the file runs for the first time, you can close it and the update will have taken place.
Footman answered 3/9, 2020 at 3:29 Comment(6)
how to find location of my chromedriver?Hadron
I opened a Finder instance and typed "chromedriver" in the search bar (make sure the search is set for "This Mac" and not "Recents"). With the results on sight, scroll down and when you see it just right click it and select "Show in Enclosing Folder". Replace at will.Footman
@KonstantinVahrushev use command which chromedriverHassan
@Hassan how to use command which chromedriver?Forwardlooking
@Čamo if you're on mac, the default path for chromedriver is /usr/local/bin/chromedriverHassan
I am on Ubuntu / Win 10 But the problem is solved.Forwardlooking
S
5

Chrome version is updating everyday so you need use exact chromedriver version according chrome version https://chromedriver.chromium.org/downloads in this website you can download chromedrivers

Selfexplanatory answered 1/6, 2020 at 7:55 Comment(0)
O
3

Your Chrome Driver version needs to match your Chrome Browser version

  1. Get you Chrome Browser version, by typing chrome://version

enter image description here

  1. Download Chrome Driver version that matches you Chrome Browser version, form this website https://chromedriver.chromium.org/downloads
Octameter answered 8/5, 2020 at 9:45 Comment(2)
Don't duplicate answers please. It has already been answered can you read before posting.Lanchow
I answered it on another page and thought I should probably add it here and I didn't bother to see answers here, will care next time 🙂Octameter
C
3

With Laravel (PHP) you can fix this with:

php artisan dusk:install

It will download and install the new driver.

Documentation: https://laravel.com/docs/9.x/dusk#installation

Caliche answered 5/7, 2022 at 9:47 Comment(0)
L
2

If you are getting this error when you run stuffs on automated cluster and you are downloading the stable version of the google chrome every time then you can use the below shell script to download the compatible version of the chrome driver dynamically every time even if the stable version of the chrome gets updated.

%sh
#downloading compatible chrome driver version
#getting the current chrome browser version
**chromeVersion=$(google-chrome --product-version)**
#getting the major version value from the full version
**chromeMajorVersion=${chromeVersion%%.*}**
# setting the base url for getting the release url for the chrome driver
**baseDriverLatestReleaseURL=https://chromedriver.storage.googleapis.com/LATEST_RELEASE_**
#creating the latest release driver url based on the major version of the chrome
**latestDriverReleaseURL=$baseDriverLatestReleaseURL$chromeMajorVersion**
**echo $latestDriverReleaseURL**
#file name of the file that gets downloaded which would contain the full version of the chrome driver to download
**latestDriverVersionFileName="LATEST_RELEASE_"$chromeMajorVersion**
#downloading the file that would contain the full release version compatible with the major release of the chrome browser version
**wget $latestDriverReleaseURL** 
#reading the file to get the version of the chrome driver that we should download
**latestFullDriverVersion=$(cat $latestDriverVersionFileName)**
**echo $latestFullDriverVersion**
#creating the final URL by passing the compatible version of the chrome driver that we should download
**finalURL="https://chromedriver.storage.googleapis.com/"$latestFullDriverVersion"/chromedriver_linux64.zip"**
**echo $finalURL**
**wget $finalURL**

I was able to get the compatible version of chrome browser and chrome driver using the above approach when running scheduled job on the databricks environment and it worked like a charm without any issues.

Hope it helps others in one way or other.

Lilas answered 21/5, 2020 at 6:53 Comment(0)
P
2

You need to install webdriver manager. Make sure webdriver manager it is also updated.

If you use npm:

npm install -g webdriver-manager

webdriver-manager update

Pyrotechnics answered 5/1, 2021 at 14:11 Comment(1)
Very simple and worked solution. Thank youWhitebook
G
2

What worked for me is this command:

pip install chromedriver-binary==your_chrome_version

This will uninstall the current chrome-driver that you have installed and will install a chrome-driver that matches your chrome version.

Greatuncle answered 9/3, 2022 at 16:0 Comment(0)
M
1

The case when your Chrome is in the middle of its update also causes this exception. In my case chromedriver was already updated, while the chrome itself was v81 instead of v83.

Monophony answered 19/5, 2020 at 19:35 Comment(0)
C
1

You can also download the correct chromedriver version from:

https://chromedriver.chromium.org/downloads https://chromedriver.storage.googleapis.com/index.html?path=81.0.4044.138/

Contend answered 22/5, 2020 at 9:24 Comment(0)
R
1

I too had a similar problem. And I've got a solution .. Download the matching chromedriver, and place the chromedriver under the /usr/local/bin path. It works.

Ringent answered 29/5, 2020 at 6:21 Comment(0)
B
1

The way I solved this issue was quite simple, I checked my chrome version and I had an older chromedriver in my PATH variable, so I downloaded the chromedriver version that matched my browser and replaced the old one in the PATH, so when the webdriver module looked for a chromedriver in my PATH, it would find the matching version

Bobseine answered 6/9, 2020 at 5:7 Comment(0)
T
1

I had already been running a local server at the same port the session wanted to run on, and this caused the error. Shutting down that local server fixed this for me.

Templas answered 30/9, 2020 at 20:48 Comment(0)
W
1

There are driver-specific NuGet packages, that copy the driver binaries to your bin folder. For example in my .NET Core project I use the latest stable NuGet from here https://www.nuget.org/packages/Selenium.WebDriver.ChromeDriver/.
Basically the NuGet contains the chromedriver.exe and copies it every time to your assembly folder (\bin\Debug\netcoreapp3.1 in my case). This is the line I have in my project:

"<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="*" />"

You can add it using:

dotnet add package Selenium.WebDriver.ChromeDriver --version *

When I first added this reference, I saw a warning for this particular package, but it disappeared after I closed and reopened my Visual Studio 2019.
The star means the latest (highest number) stable package will be used as explained here.
Of course you can install the latest version manually (without the wildcard, but selecting a specific version), and then on each 2 major Chrome versions to update the NuGet package reference so that is matches your Chrome version. (87 chromedriver works with 87 and 88 Chrome, but not with 89). Then the driver is instantiated with this lines:

var driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

This approach removes the need to specify concrete path to chromedriver.exe that will have to be updated.

Reference:
https://www.automatetheplanet.com/webdriver-net50/

Wingding answered 8/3, 2021 at 14:21 Comment(0)
V
1

If you're getting this error in Visual Studio 2019 and using Selenium.WebDriver.ChromeDriver by jsakamoto, check the version you're referencing in the packages.config file.

  <package id="Selenium.WebDriver.ChromeDriver" version="89.0.4389.2300" targetFramework="net45" />

Update your NuGet package to the appropriate version and resolve the issue.

Vinita answered 18/3, 2021 at 4:19 Comment(0)
G
1

I resolved this issue by simply running Firefox (geckodriver) instead of Chrome:

rsDriver(browser = "firefox")
Gwen answered 24/4, 2021 at 14:55 Comment(1)
As a Firefox user did not know this was possible, great alternative solution.Tallulah
P
1

I got this error after a recent chrome upgrade, and also I recently updated my Mac to Big Sur. Seems cask is not part of brew command, need to use it separately.

brew install --cask chromedriver
Perryperryman answered 23/7, 2021 at 18:25 Comment(0)
B
1

You can handle this exception

from selenium.common.exceptions import SessionNotCreatedException

Add this function

def update_chrome():
try:
    print("Updating chrome driver")
    download_chrome = "wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
    unpack_chrome = "sudo dpkg -i google-chrome-stable_current_amd64.deb"
    install_chrome = "sudo apt-get -f install"
    
    file_path = os.path.join(os.environ['HOME'], "google-chrome-stable_current_amd64.deb")
    if os.path.isfile(file_path):
        print("{} found\nremoving {}".format(file_path, file_path))
        os.remove(file_path)
    else:
        print("File does not exist {}".format(file_path))
    
    old_chrome_ver = os.popen("/usr/bin/google-chrome --version").read().strip('Google Chrome ').strip().split(".")[0]
    print("Current Chrome version: {}".format(old_chrome_ver))
    
    os.system(command=download_chrome)
    sleep(2)
    os.system(command=unpack_chrome)
    sleep(5)
    os.system(command=install_chrome)
    
    crnt_chrome_ver = os.popen("/usr/bin/google-chrome --version").read().strip('Google Chrome ').strip().split(".")[0]
    print("Current Chrome version: {}".format(crnt_chrome_ver))
    
    if crnt_chrome_ver == old_chrome_ver:
        print("Chrome version is same as before")
    elif crnt_chrome_ver > old_chrome_ver:
        print("Chrome version is updated from {} to {}".format(old_chrome_ver, crnt_chrome_ver))
    return True    

except Exception as e:
    print("Error while updating chrome: {}".format(e))
    return False

then call this function

try:
    # Your code here
except SessionNotCreatedException as snce:
    print("Session not created: {}".format(snce))
    chrome_update_result = False
    if recurrences == 0:
        chrome_update_result = update_chrome()
    if chrome_update_result:
        recurrences += 1
        print("Chrome updated successfully")
        erisapedia_bot(state, download_dir)
        return True
    else:
        print("Chrome update failed")
        return False
Bedspring answered 31/1, 2022 at 16:1 Comment(0)
T
1

For Laravel Dusk

For anyone running into this issue on Laravel Dusk for Chrome/Chromium versions after 114, this is likely caused by Google changing the upstream URLs.

Specifically for Laravel Dusk, this seems to have been fixed in this Dusk issue here, so theoretically all that's needed to fix this properly is a composer require laravel/dusk --with-all-dependencies, but at least in my case, this would update a lot of dependencies and seems highly likely to break my application. I've asked on that issue what the best course of action is for a legacy Laravel application (Laravel 8 in my case), but in the meantime: downgrading both the Chrome/Chromium browser and the Chrome driver to v114 should be a good enough workaround.

This is easier said than done and it's taken me over a day to figure out how to do it successfully on GitHub Actions, but adding the following to your workflow file should be all you need to get your builds running again:

  - name: Downgrade Chrome browser to v114
    uses: browser-actions/setup-chrome@v1
    with:
      chrome-version: 1134343 # Last commit number for Chrome v114
    id: setup-chrome
  - run: sudo ln -fs ${{ steps.setup-chrome.outputs.chrome-path }} /usr/bin/google-chrome
  - name: Downgrade Chrome driver to v114
    run: php artisan dusk:chrome-driver `/usr/bin/google-chrome --version | cut -d " " -f3 | cut -d "." -f1`
Tallulah answered 9/2, 2023 at 0:7 Comment(0)
B
1

If you are using Javascript then you can also delete the node_modules folder and also delete the package-lock.json file from the folder.And change the package.json file

define the chrome driver version you want to use ---------

"dependencies": {
    "async": "^2.6.1",
    "aws-sdk": "^2.380.0",
    "chromedriver": "^120.0.0" // like this I have Chrome version 120 so I define 120.0.0
    }

And Now run npm i

This is worked me Thanks

Bewilder answered 24/1 at 11:21 Comment(0)
K
0

The solution is:-

  • Check out the chrome version of your chrome.From chrome://settings/help
  • Check out which version of ChromeDriver is compatible with your current chrome version from here
  • download the compatible one and replace the existing ChromeDriver with a new ChromeDriver.
  • Now run the code
Kersey answered 31/5, 2020 at 0:5 Comment(0)
C
0

It didn't feel like folks were answering the issue here which is: being on the latest version of beta Chrome/Chromium and not seeing the matching chromedriver version

For example, currently as of writing this, Chromium for Mac is Version 86.0.4190.0 (Developer Build) (64-bit) however the latest chromedriver versions listed are

Current stable release: ChromeDriver 83.0.4103.39

Current beta release: ChromeDriver 84.0.4147.30

If you go to https://chromedriver.chromium.org/downloads/version-selection, they provide some pointers on getting a compatible version. One of the last lines near the end mentions trying the ChromeDriver Canary build which leads to how to get it from Chromium browser snapshots.

Of course this goes without saying that using the latest experimental version is likely to have bugs

Cheongsam answered 2/7, 2020 at 1:34 Comment(0)
K
0

I faced this problem even after using webdriver manager. I was able to resolve the issue after specifying the exact version of chromedriver that I needed in the webddriver manager.

I was using chrome version 84 and the webdriver manager was installing the latest version of chromedriver, which was 85.0.4183.38.

I made webdriver manager to open the chromedriver version 84.0.4147.30 by writing the following command.

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager

driver = webdriver.Chrome(ChromeDriverManager(84.0.4147.30).install())
Knesset answered 24/7, 2020 at 3:6 Comment(2)
Hi, just wondering where are you running this command? I'm facing an issue where my version of ChromeDriver only supports Chrome version 85. When I check my version of CHrome it is 84, but it says that version is up-to-date.Psychogenic
@Psychogenic I have a base file with a method to start a browser and specify the URL. It goes like this, def startBrowser(): global driver if Browser == "chrome": driver = webdriver.Chrome(ChromeDriverManager("83.0.4103.14").install()) elif Browser == 'firefox': driver = webdriver.Firefox(executable_path=GeckoDriverManager().install()) else: driver = webdriver.Chrome(executable_path = "./Driver/chromedriver.exe") driver.get(Application_url) driver.maximize_window() return driverKnesset
E
0

Steps I took to make it work

  1. Check your current Chrome version e.g. 81
  2. Goto tools/nuget package manager
  3. Select selenium chrome driver
  4. upgrade/downgrade to the same Chrome-version you have.

Restarting the application should work.

Epigrammatize answered 15/12, 2020 at 13:4 Comment(0)
B
0

I got this error when the chrome driver was not closed properly. Eg, if I try to find something and click it and it doesn't exist, the driver throws an exception and the thread ended there ( I did not close the driver ).

So, when I ran the same method again later where I had to reinitialize the driver, the driver didn't initialize and it threw the exception.

My solve was simply to wrap the selenium tasks in a try catch and close the driver properly

Burget answered 18/2, 2021 at 6:48 Comment(0)
I
0

It is not python related but for C# or dotnet users you might specify driver version in nuget packages. For instance Selenium.WebDriver.ChromeDriver is a good start point. It should match browser version. In chrome you can check version by accessing

chrome://settings/help

Be informed that it will also affect chrome version on pipeline agents and other developer's computers.

Industry answered 19/2, 2021 at 12:52 Comment(0)
I
0

For mac users, this is the best way to solve, Download the chromedriver and then paste that chromedriver in this directory

/usr/local/bin

If this directory is not found to you then from finder click on go then select computer then press command+shift+. (this shows the hidden files in mac) then definitely you will see these directory easily

Innkeeper answered 26/2, 2021 at 19:50 Comment(0)
K
0

Find out your current chrome version Go to settings->About chrome Go to URL https://chromedriver.chromium.org/downloads Download and use the compatible version.

Keratogenous answered 8/3, 2021 at 11:29 Comment(0)
Y
0

you just need to uninstall or delete protractor from node_module and reinstall it.

npm uninstall protractor
npm install protractor
Yoke answered 10/1, 2022 at 14:12 Comment(0)
S
0

As dylanvanw replied in the "accepted" answer above, a good solution is to install webdriver-manager.

For C#/ASP.NET Core:

  1. Nuget > Browse > webdriver-manager > WebDriverManager: Automatic Selenium WebDriver binaries management for .Net

  2. Example usage:

    public abstract class SeleniumTest {
        protected static IWebDriver driver;
        ...
        protected static void InitTestClass (string url, string waitForId) {
            if (driver == null) {
                string driverPath = new WebDriverManager.DriverManager().SetUpDriver(new ChromeConfig());
                driver = new ChromeDriver(driverPath);
                driver.Navigate().GoToUrl(url);
                ...
    
Salesman answered 4/7, 2023 at 1:4 Comment(0)
M
0

For java, using pom.xml webdriver version 5.4.1, //not working with chrome version 116...(main version), so we are going to hard code for now; //Next, we will pass it as variable with try catch statement to by bypass the hard coding after its fix //WebDriverManager.chromedriver().setup(); //hardcoded the chrome version WebDriverManager.chromedriver().driverVersion("116.0.5845.96").setup();

      ChromeOptions options = new ChromeOptions(); 
      options.addArguments("--remote-allow-origins=*"); 
      options.addArguments("--start-maximized");
      
      driver =  new ChromeDriver(options); 
Molini answered 28/8, 2023 at 20:6 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Effluvium
F
0

What worked for me in Linux Mint -->

Download Google Chrome Browser from official web (.deb file) and install it.

(In my case I did not have Google Chrome installed (just Chromium))

Frymire answered 17/1 at 19:11 Comment(0)
K
0

I got a similar problem, i was using Vs code integrated terminal. The solution was to create a venv environment, install selenium in it and do the commands from that.

Krum answered 20/2 at 15:5 Comment(0)
S
-1

Referring to @dylanvanw answer. You might still out of luck. I found that you might have a different path that you have installed Python. In my case, I have to move Chromedriver.exe from the cache path (C:\Users\Poom.wdm\drivers\chromedriver\win32\84.0.4147.30) to C:\Python38 then it work!

Silvey answered 29/7, 2020 at 8:34 Comment(0)
W
-1

I found a workaround to download latest version of ChromeDriver via WebDriverManager You could try something like,

WebDriver driver = null ;
boolean oldVersion = true;
String chromeVersion = "";
try {
    try{
        FileReader reader = new FileReader("chromeVersion.txt") ;
        BufferedReader br = new BufferedReader(reader) ;
        
        String line;
        
        while ((line = br.readLine()) != null){
            chromeVersion = line.trim();
        }
        reader.close();
    } catch (IOException e ) {}
    
    WebDriverManager.chromedriver().version(chromeVersion).setup();
    driver = new ChromeDriver() ;
} catch (Exception e) {
    oldVersion = false;
    String err = e.getMessage() ;
    chromeVersion = err.split("version is")[1].split("with binary path")[0].trim();
    try{
        FileWriter writer = new FileWriter("chromeVersion.txt", true) ;
        writer.write(chromeVersion) ;
        writer.close();
    } catch (IOException er ) {}
}

if (!oldVersion){
    WebDriverManager.chromedriver().version(chromeVersion).setup();
    driver = new ChromeDriver() ;
}

driver.get("https://www.google.com") ;
Walz answered 21/12, 2020 at 14:59 Comment(0)
C
-3

Simply Update the Chrome browser to the latest version available.

Chromatograph answered 20/7, 2020 at 22:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.