chromedriver mac - TypeError: 'module' object is not callable

677 views
Skip to first unread message

stack flow

unread,
Jul 7, 2020, 9:28:24 PM7/7/20
to robotframework-users

Hello, I am using mac osx Catalina. I am using eclipse IDE (RED editor) for Robot framework. I getting error msg "TypeError: 'module' object is not callable" . how to fix it? I have copied chromedriver in "/usr/local/bin" path.



*** Settings ***


Library    SeleniumLibrary



*** Test Cases ***


MyFirstTest

    Log    Hello World...

    

FirstSeleniumTest

    Create Webdriver    chrome    /usr/local/bin/chromedriver

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

    Set Browser Implicit Wait    5

    Input Text    name=q    dreams unlimited    

    Sleep    2    

    Close Browser


I get following error msg when I remove "Create Webdriver" from the test case. how to fix it?


WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home



Dave Amies

unread,
Jul 7, 2020, 10:46:00 PM7/7/20
to robotframework-users

I also use MacOSX

I found the easiest way to setup the webdrivers for robot framework is:

1) Install webdrivermanager:
pip install webdrivermanager 

2) use webdrivermanager to manage the drivers:
webdrivermanager chrome 

After these 2 steps it should be setup the way robot framework is looking for it, yes there are other ways to do it (changing paths or symlinks etc), but this is by far the easiest.

This approach also works on various linux distro's exactly the same way (I didn't try with Windows) 

Hope that helps.

Dave.

stack flow

unread,
Jul 7, 2020, 11:11:00 PM7/7/20
to robotframework-users
Thanks Dave for quick response. apologies but I didn't get where to define "webdrivermanager chrome".  "webdrivermanager" doesn't to be webdrivermanager library keyword.



*** Settings ***


Library    SeleniumLibrary

Library    webdrivermanager   


*** Test Cases ***


MyFirstTest

    Log    Hello World...

    

FirstSeleniumTest

    

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

    Set Browser Implicit Wait    5

    Input Text    name=q    dreams unlimited    

    Sleep    2    

    Close Browser


Dave Amies

unread,
Jul 8, 2020, 2:43:12 AM7/8/20
to robotframework-users

Sorry I guess I wasn't clear enough, webdrivermanager is not part of robot framework, it's a python utility, it sets up the web drivers for supported browsers in the way that the Selenium python module (That is used by robot framework) likes it, so those steps I gave you were command lines to run, first one is a python installer (pip) command to install webdrivermanager, second one was the webdrivermanager command to setup the chrome driver on your machine.



1) Install webdrivermanager:
pip install webdrivermanager 

2) use webdrivermanager to manage the drivers:
webdrivermanager chrome


FYI here is the documentation for webdrivermanager (https://pypi.org/project/webdrivermanager/

You only need to run these commands once and then you machine is setup, but sometimes you might need to the second command again (webdrivermanager chrome) if you get a new version of chrome and the web driver for chrome stops working.

webdrivermanager can set up the required drivers for your other browsers too (Firefox, Opera, Edge, Safari, Internet Explorer, etc) 


I hope that clears everything up,

Dave.
Reply all
Reply to author
Forward
0 new messages