NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager

Hi Mentors,
I installed today (21.01.2024)

PS D:\LEARNING\MY_LEARNING\ROBOTFRAMEWORK_VS_CODE\MyFirstProject> pip list
Package Version


docutils 0.20.1
pip 23.3.2
robotframework 7.0
robotframework-pythonlibcore 4.3.0
robotframework-seleniumlibrary 6.2.0
selenium 4.16.0
webdriver-manager 4.0.1

attrs 23.2.0
certifi 2023.11.17
cffi 1.16.0
charset-normalizer 3.3.2
h11 0.14.0
idna 3.6
outcome 1.3.0.post0
packaging 23.2
pycparser 2.21
PySocks 1.7.1
python-dotenv 1.0.0
requests 2.31.0
sniffio 1.3.0
sortedcontainers 2.4.0
trio 0.24.0
trio-websocket 0.11.1
urllib3 2.1.0
wsproto 1.2.0
PS D:\LEARNING\MY_LEARNING\ROBOTFRAMEWORK_VS_CODE\MyFirstProject> robot main.robot

I just tried to run this robot framework code but get the same exception for chrome and firefox both., No web browser is getting launched.

Chrome: Version 120.0.6099.225 (Official Build) (64-bit)
Firefox: 121.0.1 (64-bit)


*** Settings ***
Library SeleniumLibrary

*** Test Cases ***

Successful lOGIN
Open Browser https://www.google.com/ chrome


NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: Unable to Locate Driver Error | Selenium
NoSuchDriverException: Message: Unable to obtain driver for firefox using Selenium Manager.; For documentation on this error, please visit: Unable to Locate Driver Error | Selenium

I tried the internet searching but do not get them launched.

Using the windows cmd it gives:

Selenium-manager.exe - Application Error
The application was unable to start correctly (0xc000007b). Click Ok to close the application.

Any help will be greatly appreciated
Really want to learn Robot Framework.
Sincere Regards
EagerToLearn

Hi @EagerToLearn,

My post in this thread should be helpful, read the full thread if you want to understand the issue.

Dave.

Hi Dave,
I tried the solution and had found it in my searching but I still get the same exception:
SeleniumDrivers.robot

*** Settings ***
Documentation These keywords need the webdriver-manager module
… pip install webdriver-manager
webdriver-manager · PyPI

*** Keywords ***
Update Chrome Webdriver
[Documentation] Update Chrome Web Driver
${driverpath}= Evaluate webdriver_manager.chrome.ChromeDriverManager().install() modules=webdriver_manager.chrome
RETURN ${driverpath}

Update Firefox Webdriver
[Documentation] Update Firefox Web Driver
${driverpath}= Evaluate webdriver_manager.firefox.GeckoDriverManager().install() modules=webdriver_manager.firefox
RETURN ${driverpath}

main.robot

*** Settings ***
Library SeleniumLibrary
Resource SeleniumDrivers.robot

Suite Setup Update Chrome Webdriver

*** Test Cases ***

Successful lOGIN
Open Browser url=https://www.google.com/ browser=firefox

Any more ideas are greatly appreciated.
Thank you.
EagerToLearn

Hi.
I would like to know that which versions of:

  • Robot framework
  • Selenium
    were perfectly working where the chromedriver issue was not there.

My main urgent need is to get my things done and with this NoDriverException it is completely stuck.
Sincere Regards
EagerToLearn

Hi @EagerToLearn,

This is my understanding of the situation:

SeleniumLibrary and the underlying Selenium works with robot framework and all the browsers now, there was a short period of time where things didn’t work because google changes the way drivers interacted with chrome, then Selenium got updated to work with the new webdrivers but that broke SeleniumLibrary. The old webdrivers didn’t work with newer Selenium and older Selenium didn’t work with newer web drivers

Basically avoid the versions mentioned in that thread I linked before, I’d suggest just getting the newest Selenium and SeleniumLibrary.

In the early days you needed to manually download the webdrivers for Selenium (not just for robot framework’s SeleniumLibrary, but for any tool that used Selenium.

Later there came tools like webdrivermanager that would download the webdrivers and setup the path for you automatically, this made life easier as whenever a browser got updated you could just run a single command to update the webdriver, unfortunately the chrome change also broke this tool

The post I linked basically gives you the ability to do what webdrivermanager did but within robot framework, the Selenium Manager should download the webdriver where Selenium wants them as Selenium Manager is aparently part of Selenium

So with robotframework-seleniumlibrary 6.2.0 and selenium 4.16.0 that you have the Selenium Manager code I gave in that other thread should install the webdriver for Chrome >114

If you’re still getting NoSuchDriverException, check the path that was returned with ${driverpath} by Update Chrome Webdriver and check if that is in your os’s path variable

Hope that helps,

Dave.

Hi,
So nice of you for your time, Dave.
I tried with a pure clean install again and found out that the chromedriver.exe is being copied here and then also added the path to the Windows Path variables there:
- For Chrome
C:\Users\munee.wdm\drivers\chromedriver\win64\121.0.6167.57\chromedriver-win32/chromedriver.exe
- For Firefox
C:\Users\munee.wdm\drivers\geckodriver\win64\v0.34.0\geckodriver.exe

Code looks like this now


*** Settings ***
Library SeleniumLibrary
Resource SeleniumDrivers.robot
Suite Setup Update Chrome Webdriver

*** Test Cases ***
Successful Login
Open Browser https://www.google.com/ Chrome


*** Settings ***
Documentation These keywords need the webdriver-manager module
… pip install webdriver-manager
webdriver-manager · PyPI

*** Keywords ***
Update Chrome Webdriver
[Documentation] Update Chrome Web Driver
${driverpath}= Evaluate webdriver_manager.chrome.ChromeDriverManager().install() modules=webdriver_manager.chrome
Log ${driverpath}
RETURN ${driverpath}

Update Firefox Webdriver
[Documentation] Update Firefox Web Driver
${driverpath}= Evaluate webdriver_manager.firefox.GeckoDriverManager().install() modules=webdriver_manager.firefox
Log ${driverpath}
RETURN ${driverpath}


I still get the same exception:

NoSuchDriverException: Message: Unable to obtain driver for chrome using Selenium Manager.

NoSuchDriverException: Message: Unable to obtain driver for firefox using Selenium Manager.

Any help is greatly appreciated like always :slight_smile:
Sincere Regards
EagerToLearn

Ok I see those a Windows paths, FYI - you do need to close and re-open the command window on Windows after you change the path for it to take effect.

If that doesn’t resolve it, there’s another way you can approach it, the reason ${driverpath} gets returned is so you can do something this:

	${driverpath}= 	Update Chrome Webdriver
	Open Browser 	http://www.duck.com 	Chrome 	executable_path=${driverpath}

Dave.

Hi Dave, So nice of you.
Finally it has worked.
Thank you and wish you a very nice day :slight_smile:
EagerToLearn

1 Like