Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: WebDriver.__init__() got an unexpected keyword argument 'service_log_path' #1835

Closed
LLinden opened this issue Jun 7, 2023 · 60 comments

Comments

@LLinden
Copy link

LLinden commented Jun 7, 2023

Hi,

When I try to run a robot test I'm getting the following error:

TypeError: WebDriver.__init__() got an unexpected keyword argument 'service_log_path'

Similar to this resolved issue: #1419

Although I'm using Chrome and I've already using the latest versions of SeleniumLibarary, Chromedriver and Robot.

python --version
Python 3.11.4

robot --version
Robot Framework 6.0.2 (Python 3.11.4 on win32)

chromedriver --version
ChromeDriver 114.0.5735.90

I've installed SeleniumLibary today via pip install --upgrade robotframework-seleniumlibrary

Chrome version: 114.0.5735.110 64 bits

The project that I'm using is this:
https://gitlab.com/bftft/robot-framework-testautomationu-2022/-/tree/main/

An exemple of test that I'm trying to run is this:
https://gitlab.com/bftft/robot-framework-testautomationu-2022/-/tree/main/005-TestCases

first-test-case.ansewer.robot

I appreciate any help.

@emanlove
Copy link
Member

emanlove commented Jun 7, 2023

@LLinden I recognize that project. That is Paul Merrill's Test Automation course. I will take a look and see what I can see ..

@LLinden
Copy link
Author

LLinden commented Jun 7, 2023

@emanlove yes, it is! I'm using to learn Robot Framework. Thank you very much.

In another machine the project was working, but when I migrate to a new one and had to reinstall all the programs needed I encontered this error.

@emanlove
Copy link
Member

emanlove commented Jun 7, 2023

I did a quick check and I see the same error. I have a few things over the next few hours which will take me offline. But if I can't resolve within the next hour I will work on it this evening

@LLinden
Copy link
Author

LLinden commented Jun 7, 2023

@emanlove thanks a lot!

@emanlove
Copy link
Member

emanlove commented Jun 7, 2023

The quick fix seems to be to downgrade selenium to 4.9.0 which you can do by typing at the command prompt pip install selenium==4.9.0. (I'll note that is you are either using a virtualenv or possible some IDEs like PyCharm then you will need to make sure you install the python package under the correct instance of Python)

Still need time time see what is going on and check to see if Selenium 4.10.0, which I see just got released 4 hours ago, broke something that either SeleniumLibrary needs to fix or selenium possibly.

@LLinden
Copy link
Author

LLinden commented Jun 7, 2023

I see.
The quick fix worked! Thank you very much for the quick response @emanlove great job!

@emanlove
Copy link
Member

emanlove commented Jun 7, 2023

I will check tonight to see if there is a larger problem. Thanks for reporting this as I can make a notice in our Slack channel as well.

@anthonphax
Copy link

I'm using robot framework and got:
TypeError: __init__() got an unexpected keyword argument 'service_log_path'
I use robotframework-seleniumlibrary=6.0.0,
6.1.0, 5.1.3 , 4.5.0 are not working.
Any ideas?

@Cajova-Houba
Copy link

Cajova-Houba commented Jun 7, 2023

Hello,

I'm running following setup:

  • python --version: Python 3.8.2
  • robot --version: Robot Framework 6.0.2 (Python 3.8.2 on win32)
  • pip packages
    • robotframework==6.0.2
    • robotframework-pythonlibcore==4.1.2
    • robotframework-seleniumlibrary==6.1.0
    • selenium==4.10.0

When opening browser using either gecko or chromedrive, I get following errors:

  • gecko: TypeError: init() got an unexpected keyword argument 'firefox_profile'
  • chrome: TypeError: init() got an unexpected keyword argument 'service_log_path'

Downgrading to selenium 4.9.0 using pip install selenium==4.9.0 fixed the issue. Thanks a lot @emanlove !

@emanlove
Copy link
Member

emanlove commented Jun 7, 2023

@anthonphax try downgrading your selenium to 4.9.0 which can be done with pip install selenium=4.9.0. Is this does not resolve your problem reach out again.

@emanlove
Copy link
Member

emanlove commented Jun 9, 2023

Updated I should also note I completely missed there is a v4.9.1 of selenium [changelog here] which one should downgrade (temporarily to that). So pip install selenium==4.9.1. Either v4.9.0 or 4.9.1 will work and I do prefer the latest working version so I suggest v4.9.1.

@tvigneshnayak
Copy link

pip install selenium==4.9.0

@emanlove thanks for the solution. It worked for me. I was using selenium 4.10.0 and Robot Framework 6.1 (Python 3.11.3 on win32 , OS - windows 11 pro). After downgrading to selenium 4.9.0, it is working fine.

But I am facing a problem, if you have time, let me know the solution.
*** Test Cases ***
Sample Test Case for verifying the basic functionality
[Documentation] Test case documentation
Open Browser https://www.youtube.com chrome
Input Text //[@id="search"] never
Press Keys //
[@id="search-icon-legacy"]/yt-icon/yt-icon-shape/icon-shape/div RETURN
# Add more test steps if needed
Page Should Contain never
Sleep 5s
Close Browser

Input Text //*[@id="search"] never ---- this step is not executing, it is showing InvalidElementStateException. I have attached the log file. Please let me know what is wrong with my steps.
log.pdf

@emanlove
Copy link
Member

@tvigneshnayak As that issue appears distinctly different than the main issue of this thread, it would be best to open a new issue so you get the best support and provided visibility and understanding to others.

@anthonphax
Copy link

anthonphax commented Jun 13, 2023

@emanlove solved this by including selenium==4.9.1 and robotframework-seleniumlibrary==6.0.0 on my build. tks!

@mjblue
Copy link

mjblue commented Jun 13, 2023

service_log_path along with a few other options were removed as they are now deprecated:

SeleniumHQ/selenium@9f5801c

This will require a bigish update to SeleniumLIbrary to switch to using a Service :(

@emanlove
Copy link
Member

@mjblue As part of the planned/in-progress hotfix I have in mind straightforward switch that can be done within the library side of the code so little if any user code needs to change. @aaltat has suggested and I agree that making a Service "class" similar to the way the internal library code handles the options would be good solution. I'm not sure if that will be here in the hotfix or in the next release.

@mjblue
Copy link

mjblue commented Jun 13, 2023

Thanks @emanlove , I agree that should be able to be handled in the library by Switching to passing a service with the options rather than passing the options directly. Good Stuff, thanks for the update.

@tvigneshnayak
Copy link

@tvigneshnayak As that issue appears distinctly different than the main issue of this thread, it would be best to open a new issue so you get the best support and provided visibility and understanding to others.

Sure @emanlove I have created a new issue #1838

mauritsvanrees added a commit to plone/buildout.coredev that referenced this issue Jun 13, 2023
…mlibrary.

```
TypeError: WebDriver.__init__() got an unexpected keyword argument 'service_log_path'
```

A fix is in the making:
robotframework/SeleniumLibrary#1835
@pepe-feliu
Copy link

I was having the same error: TypeError: WebDriver.init() got an unexpected keyword argument 'service_log_path'.

I was using robotframework==6.1.0 and selenium==4.10.0. As recommended in this thread, I downgraded to selenium==4.9.1 but it didn't work for me.

The error I'm getting now is: OSError: [Errno 86] Bad CPU type in executable: '/opt/homebrew/lib/python3.11/site-packages/selenium/webdriver/common/macos/selenium-manager'

Does anyone have a clue to fixing this?

Thanks in advance!

@filipehba
Copy link

thank you @emanlove, i had the same problem.

@Vitor1973
Copy link

I had this problem for 1 day, but with @emanlove's tip it solved the code. Thanks

ppodgorsek added a commit to ppodgorsek/docker-robot-framework that referenced this issue Jun 21, 2023
* Reverted to an older version of Selenium (see robotframework/SeleniumLibrary#1835)
* Removed failing tests for the Requests library (the most important is to test that library can be used, not to replicate its own tests)
@GlaucoFernandes31
Copy link

I was having the same problem, I was even thinking that it was some setting of annotation in the variables in the PATH. But with @emanlove's mentorship, the problem was remedied. Thanks!

@DirkRichter
Copy link

Reason: Selenium driver instantiation via service_log_path was removed in selenium 4.10.0:
grafik

SeleniumHQ/selenium@selenium-4.9.0...selenium-4.10.0#diff-5a60156e0c8a7c920aa161d26581ca3461625b9ea29c059bae02999fd388f22fL46

@Aakash1045
Copy link

Aakash1045 commented Jul 11, 2023

image
Hi @emanlove ,
I am running on->
python --version
Python 3.11.4
robot --version
Robot Framework 6.0.2 (Python 3.11.4 on win64)
Chromedriver --version
ChromeDriver 114.0.5735.90
selenium 4.9.0
We also tried on selenium 4.9.1
But still our device it shows error like
TypeError: init() got an unexpected keyword argument 'service_log_path'
Can you help me to come out from this ….

@emanlove
Copy link
Member

@Aakash1045 The only way that error comes is if you have running Selenium 4.10.0. Be careful that you are not running multiple pythons or a virtualenv with a v4.10.0 version of selenium. Also I am a bit cautious with running Python 3.11 but that should not give this error (if it does at all).

@Aakash1045
Copy link

Aakash1045 commented Jul 11, 2023 via email

@wolfred24
Copy link

wolfred24 commented Jul 11, 2023

I tried the workaround but is not working for me:

==============================================================================
Crm :: Some basic info about this test suite                                  
==============================================================================
This is the test case title :: My first test case                     | FAIL |
TypeError: WebDriver.__init__() got an unexpected keyword argument 'service_log_path'
------------------------------------------------------------------------------
Crm :: Some basic info about this test suite                          | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Output:  /Users/cesar/developement/robot_training/output.xml
Log:     /Users/cesar/developement/robot_training/log.html
Report:  /Users/cesar/developement/robot_training/report.html

Installed pip packages:

robotframework                 6.1
robotframework-pythonlibcore   4.2.0
robotframework-seleniumlibrary 6.1.0
selenium                       4.9.0

Python version:
Python 3.11.4 (v3.11.4:d2340ef257, Jun 6 2023, 19:15:51) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin

@emanlove
Copy link
Member

emanlove commented Jul 11, 2023

@Wolfred What do you get for the following commands

$ which python
$ robot --version
$ python --version
$ python -m pip list -vv
$ python -c "import sys; print(sys.executable)"

Also, are you running though an IDE?

@emanlove
Copy link
Member

Ok, I'll review my setup and see if I see how that is configured on my machine. You've posted the two screenshots but neither contain the command to execute those. Could you share those? or at least review them to see if they appear to run the same Python version?

@wolfred24
Copy link

which python

Yes im running it on the terminal:
image

This is the output of the commands:

cesar@cesars-mbp ~ % which python3
/usr/bin/python3
cesar@cesars-mbp ~ % robot --version
Robot Framework 6.1 (Python 3.9.6 on darwin)
cesar@cesars-mbp ~ % python3 --version
Python 3.9.6
cesar@cesars-mbp ~ % python -m pip list -vv
zsh: command not found: python
cesar@cesars-mbp ~ % python3 -m pip list -vv
Package                        Version  Location                                                                                                          Installer
------------------------------ -------- ----------------------------------------------------------------------------------------------------------------- ---------
altgraph                       0.17.2   /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages pip
attrs                          23.1.0   /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
certifi                        2023.5.7 /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
exceptiongroup                 1.1.2    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
future                         0.18.2   /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages pip
h11                            0.14.0   /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
idna                           3.4      /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
macholib                       1.15.2   /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages pip
outcome                        1.2.0    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
pip                            23.1.2   /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
PySocks                        1.7.1    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
robot                          20071211 /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
robotframework                 6.1      /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
robotframework-pythonlibcore   4.2.0    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
robotframework-seleniumlibrary 6.1.0    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
selenium                       4.10.0   /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
setuptools                     58.0.4   /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages pip
six                            1.15.0   /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages pip
sniffio                        1.3.0    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
sortedcontainers               2.4.0    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
trio                           0.22.1   /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
trio-websocket                 0.10.3   /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
urllib3                        2.0.3    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
wheel                          0.37.0   /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages pip
wsproto                        1.2.0    /Users/cesar/Library/Python/3.9/lib/python/site-packages                                                          pip
Remote version of pip: 23.1.2
Local version of pip:  23.1.2
Was pip installed by pip? True
cesar@cesars-mbp ~ % python3 -c "import sys; print(sys.executable)"
/Library/Developer/CommandLineTools/usr/bin/python3
cesar@cesars-mbp ~ % 
```

@robottester-sketch
Copy link

robottester-sketch commented Jul 12, 2023

I am not using any command to run the test file in VS code, I created a simple test to Open Browser and click the Run command on top right and I get the message in Terminal. I can attach the screenshot from VS code . I am using Python 3.11.4

image

@emanlove
Copy link
Member

@wolfred24 From the info you have shared I do see two Pythons installed: 3.11 and 3.9.6. In your most recent comment I see the 3.9.6 which appears to be the one ran when you get the error does indeed have Selenium v4.10.0 installed. If you type python3 pip install selenium==4.9.1 that should install the earlier/working version of selenium under your 3.9.6 instance.

@wolfred24
Copy link

wolfred24 commented Jul 12, 2023

You are right! Thanks a lot @emanlove

cesar@cesars-mbp Tests % robot crm.robot
/Users/cesar/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
==============================================================================
Crm :: Some basic info about this test suite                                  
==============================================================================
This is the test case title :: My first test case                     | FAIL |
WebDriverException: Message: Service /usr/local/bin/chromedriver unexpectedly exited. Status code was: -9
------------------------------------------------------------------------------
Crm :: Some basic info about this test suite                          | FAIL |
1 test, 0 passed, 1 failed
==============================================================================
Output:  /Users/cesar/developement/robot_training/Tests/output.xml
Log:     /Users/cesar/developement/robot_training/Tests/log.html
Report:  /Users/cesar/developement/robot_training/Tests/report.html
cesar@cesars-mbp Tests % robot crm.robot
/Users/cesar/Library/Python/3.9/lib/python/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
==============================================================================
Crm :: Some basic info about this test suite                                  
==============================================================================
This is the test case title :: My first test case                     | PASS |
------------------------------------------------------------------------------
Crm :: Some basic info about this test suite                          | PASS |
1 test, 1 passed, 0 failed
==============================================================================
Output:  /Users/cesar/developement/robot_training/Tests/output.xml
Log:     /Users/cesar/developement/robot_training/Tests/log.html
Report:  /Users/cesar/developement/robot_training/Tests/report.html

@emanlove
Copy link
Member

@robottester-sketch That run "button" command is creating the command for you and executing it for you. If you scrolled up you will see what this is, something like

PS C:\Robot> python -m robot.run pftest,.robot
==============================================================================
Pftest
==============================================================================
...

That first line will tell you a bit about how your script is being executed. Now that run button is what VS Code calls, a Run Configuration. These are configured generally on a "project" level but may be on a folder level as well. I am not super familiar with how VS Code does this nor how the extensions overwrite or supersede the project level ones. (Basically who is setting this and where they keep that info). .. um .. at this point we might need to go back and forth a little or you can dive down that path yourself. The command the run button uses as well as the run configuration (Run menu item > Open Configurations) should give you a head start. Here I must admit I am looking at my setup which I just was running RoboCode and some VScode commands to have the Robotcode extension do the execution. I didn't/hadn't looked behind the scenes yet to see al what they are doing how it is configured. Good reminder again is that what we are looking for is which Python instance is being executed and which selenium version is loaded on that one.

@robottester-sketch
Copy link

robottester-sketch commented Jul 12, 2023

As I am a beginner, I do not know much of the configurations yet.

image

Attached is the screenshot of the terminal when I click the run button. and below is the pip list from my machine
Package Version


attrs 23.1.0
beautifulsoup4 4.12.2
cached-property 1.5.2
certifi 2023.5.7
cffi 1.15.1
chardet 3.0.4
charset-normalizer 3.2.0
click 8.1.4
colorama 0.4.6
comtypes 1.2.0
convertdate 2.4.0
cryptography 41.0.2
decorator 5.1.1
defusedxml 0.7.1
dnspython 2.3.0
docutils 0.20.1
et-xmlfile 1.1.0
exceptiongroup 1.1.2
exchangelib 4.9.0
fire 0.4.0
fonttools 4.40.0
fpdf2 2.7.4
furl 2.1.3
graphviz 0.13.2
h11 0.14.0
hijri-converter 2.3.1
holidays 0.21.13
htmldocx 0.0.6
hubspot-api-client 4.0.6
idna 3.4
importlib-metadata 4.13.0
isodate 0.6.1
java-access-bridge-wrapper 0.14.1
jsonpath-ng 1.5.3
jsonschema 4.18.2
jsonschema-specifications 2023.6.1
korean-lunar-calendar 0.3.1
lxml 4.9.3
mss 6.1.0
netsuitesdk 1.24.0
notifiers 1.3.3
O365 2.0.26
oauthlib 3.2.2
openpyxl 3.1.2
orderedmultidict 1.0.1
outcome 1.2.0
packaging 23.1
pdfminer.six 20221105
pendulum 2.1.2
Pillow 9.5.0
pip 23.1.2
platformdirs 3.8.1
ply 3.11
psutil 5.9.5
pycparser 2.21
Pygments 2.15.1
PyJWT 2.7.0
PyMeeus 0.5.12
pynput-robocorp-fork 5.0.0
pyotp 2.8.0
pypdf 3.12.1
pyperclip 1.8.2
PySocks 1.7.1
pyspnego 0.9.1
python-dateutil 2.8.2
python-docx 0.8.11
python-dotenv 1.0.0
pytz 2023.3
pytz-deprecation-shim 0.1.0.post0
pytzdata 2020.1
pywin32 303
pywinauto 0.6.8
PyYAML 6.0
referencing 0.29.1
requests 2.31.0
requests-file 1.5.1
requests-ntlm 1.2.0
requests-oauthlib 1.3.1
requests-toolbelt 1.0.0
robocorp-storage 0.2.0
robotframework 5.0.1
robotframework-pythonlibcore 4.2.0
robotframework-requests 0.9.5
robotframework-sapguilibrary 1.1
robotframework-seleniumlibrary 6.1.0
robotframework-seleniumtestability 2.1.0
rpaframework 23.5.2
rpaframework-core 11.0.2
rpaframework-pdf 7.1.5
rpaframework-windows 7.3.2
rpds-py 0.8.10
selenium 4.9.1
setuptools 65.5.0
simple-salesforce 1.12.4
six 1.16.0
smartsheet-python-sdk 3.0.2
sniffio 1.3.0
sortedcontainers 2.4.0
soupsieve 2.4.1
stringcase 1.2.0
tenacity 8.2.2
termcolor 2.3.0
tqdm 4.65.0
trio 0.22.1
trio-websocket 0.10.3
tweepy 3.10.0
tzdata 2023.3
tzlocal 4.3.1
uiautomation 2.0.18
urllib3 2.0.3
validators 0.20.0
webdriver-manager 3.8.6
wrapt 1.15.0
wsproto 1.2.0
xlrd 2.0.1
xlutils 2.0.0
xlwt 1.3.0
zeep 4.2.1
zipp 3.16.0

Attached is the launch.json if this helps
image

One of the blog mentioned the below but not sure how to do it?
image

@emanlove
Copy link
Member

Looks like RobotCode defers to the Robot Language server settings for the Python it is executing. Go to the Robot Language Server extension's settings as shown here
image
[noting you need to click on the gear icon to get the context menu which is covering the gear icon in my screenshot]. Then scroll down to the Robot > Language-server: Python setting and share what is there
image

@robottester-sketch
Copy link

Ok I added and restarted VS code and executed the test, its the same issue

@emanlove
Copy link
Member

emanlove commented Jul 12, 2023

Sorry for all this confusion. System setups can at times be tricky. Was just looking to what yours was set as. The one above is from my system and just an example.

[Updated: You might not be using fully the robotcode extensions and its templates. If you don't have by default a conda.yaml in your project then this suggestion would bnot be for how you have your setup. Sorry again]

Also I realized the way I am going about it might be through the backdoor since you are using Robotcode. Try this, add the package to your conda.yaml file, as I have done with the very last line here,

...
dependencies:
  # Define conda-forge packages here -> https://anaconda.org/search
  # When available, prefer the conda-forge packages over pip as installations are more efficient.
  - python=3.9.13               # https://pyreadiness.org/3.9/ 
  - pip=22.1.2                  # https://pip.pypa.io/en/stable/news/
  - pip:
      # Define pip packages here -> https://pypi.org/
      - rpaframework==22.5.3    # https://rpaframework.org/releasenotes.html
      - selenium==4.9.1

[The rest is the default I had when I created theproject template, Yours may be different]

@robottester-sketch
Copy link

Its working now, thankyou so much for your time and help

@emanlove
Copy link
Member

Glad to hear that! I just started using the Robocorp Code extension a couple days ago as part of their RPA certification courses. So I wasn't super familiar with how it configures and uses Python on one's system. That is whether it uses the system Python or something else. (At a basic level It does appear to use the Language Server setting. But I suspect if that is not set it may create its own virtualenv). Also it is not clear to me how Robocorp code extension works within "projects" that might not have all the project files (like conda.yaml and robot.yaml) that I got by using the Robocorp: Create robot command. Realizing though that you might have a similar project structure and a conda,yml I searched their documentation to see how under a Robocorp project one adds python packages. Looks like that was the way. So in the future if you have a missing Python package or version issues then this might be the solution to resolve that instead of a straight pip install *******.

@paliandris02
Copy link

Big thanks @emanlove

@robottester-sketch
Copy link

Hi emanlove, I want to check on another issue , how to start a thread for that issue or question

@emanlove
Copy link
Member

@robottester-sketch If you are a looking for support or want to review an issue the best place to start is the Robot Framework Slack community. But if that channel is not best for you, you can open a new issue either from an existing issue like this one (1) or from the Issue link in the main repository menu above (2).
image

Note it is best to read through and follow the issue template that is provided when you start a new issue . Doing so helps us to help you.

@robottester-sketch
Copy link

Thankyou emanlove I will do so

@pabloFalco
Copy link

Issuing the command pip install selenium=4.9.1 solved the issue for me, I really was in panic with this (first time doning testing)
Thank you!

@samuelpcabral
Copy link

Hi, I got this issue today in a new computer with python 11

with this packages:

------------------------------ --------
attrs                          23.1.0
certifi                        2023.5.7
cffi                           1.15.1
cryptography                   41.0.2
exceptiongroup                 1.1.2
h11                            0.14.0
idna                           3.4
outcome                        1.2.0
pip                            23.1.2
pycparser                      2.21
pyOpenSSL                      23.2.0
PySocks                        1.7.1
robotframework                 6.1
robotframework-pythonlibcore   4.2.0
robotframework-seleniumlibrary 6.1.0
selenium                       4.10.0
setuptools                     65.5.0
sniffio                        1.3.0
sortedcontainers               2.4.0
trio                           0.22.2
trio-websocket                 0.10.3
urllib3                        1.26.16
urllib3-secure-extra           0.1.0
wsproto                        1.2.0

Then I read this topic and compared with other computer that I am using for tests
and resolved doing a downgrade of selenium to: pip install selenium==4.3.0

Now is working with this list of packages:

------------------------------ --------
attrs                          23.1.0
certifi                        2023.5.7
cffi                           1.15.1
cryptography                   41.0.2
exceptiongroup                 1.1.2
h11                            0.14.0
idna                           3.4
outcome                        1.2.0
pip                            23.1.2
pycparser                      2.21
pyOpenSSL                      23.2.0
PySocks                        1.7.1
robotframework                 6.1
robotframework-pythonlibcore   4.2.0
robotframework-seleniumlibrary 6.1.0
selenium                       4.3.0
setuptools                     65.5.0
sniffio                        1.3.0
sortedcontainers               2.4.0
trio                           0.22.2
trio-websocket                 0.10.3
urllib3                        1.26.16
urllib3-secure-extra           0.1.0
wsproto                        1.2.0

@Pravin31830
Copy link

Pravin31830 commented Jul 24, 2023

Hi @emanlove

I too facing same error TypeError: WebDriver.__init__() got an unexpected keyword argument 'service_log_path'
Here's the text arranged in a table format:

Package Version Location Installer
attrs 23.1.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
certifi 2023.5.7 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
cffi 1.15.1 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
cryptography 41.0.2 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
exceptiongroup 1.1.2 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
h11 0.14.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
idna 3.4 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
outcome 1.2.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
pip 23.2.1 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
pycparser 2.21 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
pyOpenSSL 23.2.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
PySocks 1.7.1 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
robotframework 6.1 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
robotframework-pythonlibcore 4.2.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
robotframework-seleniumlibrary 6.1.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
selenium 4.9.1 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
setuptools 65.5.0 C:\Program Files\Python311\Lib\site-packages pip
sniffio 1.3.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
sortedcontainers 2.4.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
trio 0.22.2 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
trio-websocket 0.10.3 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
urllib3 1.26.16 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
urllib3-secure-extra 0.1.0 C:\Users\pravi\AppData\Roaming\Python\Python311\site-packages pip
wsproto 1.2.0

C:\Users\pravi>python --version Python 3.11.3

@Meem12
Copy link

Meem12 commented Jul 31, 2023

hi guys
I been using RObot framework for few days . I ah ve created script and that's running fine but i have to create a new script but in that I'm just unbale to launch the browser getting this erroro : TypeError: WebDriver.init() got an unexpected keyword argument 'service_log_path'. I download Selenium to 4.9.0 but still the same issue, I really need to create this new script , can some one plz help

@emanlove
Copy link
Member

@Meem12 If you are getting this error it means which ever Python is executing the script has Selenium v4.10.0 installed. If you are using a IDE with extensions you will need to configure either the Python or the Packages it installs.

@Meem12
Copy link

Meem12 commented Jul 31, 2023 via email

@emanlove
Copy link
Member

emanlove commented Aug 2, 2023

A release candidate v6.1.1rc1 has been pushed to PyPI which is intended to resolve this issue. If you have pip installed, just run

pip install --pre --upgrade robotframework-seleniumlibrary

to install this release candidate or as I prefer use

pip install robotframework-seleniumlibrary==6.1.1rc1

to install exactly this version. The changes are all internal and very subtle. I recommend people do some check under certain conditions to verify this is working for you as it did previously based upon how you use the Open Browser keyword. Notes about this are in the release notes for v6.1.1rc1 and can be found at https://github.com/robotframework/SeleniumLibrary/blob/master/docs/SeleniumLibrary-6.1.1rc1.rst

Please read through these thoroughly and follow the recommended verification steps before one comments. Thank you.

@Meem12
Copy link

Meem12 commented Aug 3, 2023 via email

@emanlove
Copy link
Member

emanlove commented Aug 4, 2023

This has been fixed in the SeleniumLibrary v6.1.1 release.

@emanlove emanlove closed this as completed Aug 4, 2023
@Meem12
Copy link

Meem12 commented Aug 4, 2023 via email

@perlun
Copy link

perlun commented Aug 22, 2023

For reference, this is the issue I was looking for when debugging this. 😅 I googled but I must have been doing a too bad job. (I even see now that it's one the very first page of the Google search results, and I might even have opened it, but I think that the fact that this referred to service_log_path instead of firefox_profile didn't catch my attention well enough. 😐)

Anyway, here's the error I was seeing: WebDriver.__init__() got an unexpected keyword argument 'firefox_profile'. Adding more logging to the Robot test runner with --loglevel DEBUG --debugfile output.log gave me this in the output.log file:

==============================================================================
20230822 08:33:58.107 - INFO - + START SUITE: TestSuite [ ]
==============================================================================
20230822 08:33:58.169 - INFO - +- START SUITE: TestSuite.Assign To Room [ ]
==============================================================================
20230822 08:33:58.170 - INFO - +-- START TEST: Open Keyboard in RoomSelector [ ]
------------------------------------------------------------------------------
20230822 08:33:58.170 - INFO - +--- START KEYWORD: Hotel_Keywords.Open RoomSelector [ ${deviceSerial} ]
20230822 08:33:58.170 - INFO - +---- START KEYWORD: SeleniumLibrary.Open Browser [ ${URL}/path?ke=value1&key2=${value2} | ${Browser} ]
20230822 08:33:58.170 - INFO - Opening browser 'Firefox' to base url 'http://dind:32784/app/path?key1=value1&key2=value2.
20230822 08:33:58.171 - INFO - Firefox driver log is always forced to to: /path/to/output/geckodriver-1.log
20230822 08:33:58.171 - INFO - Cannot capture screenshot because no browser is open.
20230822 08:33:58.171 - FAIL - TypeError: WebDriver.__init__() got an unexpected keyword argument 'firefox_profile'
20230822 08:33:58.171 - DEBUG - Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/SeleniumLibrary/__init__.py", line 496, in run_keyword
    return DynamicCore.run_keyword(self, name, args, kwargs)
  File "/usr/local/lib/python3.10/dist-packages/robotlibcore.py", line 126, in run_keyword
    return self.keywords[name](*args, **(kwargs or {}))
  File "/usr/local/lib/python3.10/dist-packages/SeleniumLibrary/keywords/browsermanagement.py", line 293, in open_browser
    return self._make_new_browser(
  File "/usr/local/lib/python3.10/dist-packages/SeleniumLibrary/keywords/browsermanagement.py", line 324, in _make_new_browser
    driver = self._make_driver(
  File "/usr/local/lib/python3.10/dist-packages/SeleniumLibrary/keywords/browsermanagement.py", line 716, in _make_driver
    driver = self._webdriver_creator.create_driver(
  File "/usr/local/lib/python3.10/dist-packages/SeleniumLibrary/keywords/webdrivertools/webdrivertools.py", line 83, in create_driver
    return creation_method(
  File "/usr/local/lib/python3.10/dist-packages/SeleniumLibrary/keywords/webdrivertools/webdrivertools.py", line 199, in create_firefox
    return webdriver.Firefox(
TypeError: WebDriver.__init__() got an unexpected keyword argument 'firefox_profile'
20230822 08:33:58.171 - INFO - +---- END KEYWORD: SeleniumLibrary.Open Browser (1)
20230822 08:33:58.171 - INFO - +---- START KEYWORD: SeleniumLibrary.Set Window Size [ 1920 | 1080 ]
20230822 08:33:58.171 - INFO - +---- END KEYWORD: SeleniumLibrary.Set Window Size (0)
20230822 08:33:58.171 - INFO - +---- START KEYWORD: SeleniumLibrary.Wait Until Page Contains [ <something> | 10s ]
20230822 08:33:58.171 - INFO - +---- END KEYWORD: SeleniumLibrary.Wait Until Page Contains (0)
20230822 08:33:58.171 - INFO - +--- END KEYWORD: Hotel_Keywords.Open RoomSelector (1)

The fix in this case is one of the following:

I feel silly about having spent so much time on this, but here goes. Maybe this will help someone else out there. Take care. 👍

@nra-Dvg
Copy link

nra-Dvg commented Nov 20, 2023

I also faced the same issue after upgrading the robot framework & some robo libraries. after I downgraded selenium & robotframework-seleniumlibrary. now it's working fine for me.

used selenium==4.1.3 & robotframework-seleniumlibrary 6.0.0 & robotframework 5.0.1

@emanlove
Copy link
Member

@nra-Dvg A few questions .. which issue in particular (as people have listed a few here)? And upgrading to which SeleniumLibrary, Selenium and Robot Framework versions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests