Open Browser fails if desired capabilities is a dict
See original GitHub issueThis issue goes away if you revert to SeleniumLibrary 3.2.0
Steps to reproduce the issue
*** Settings ***
Library SeleniumLibrary
*** Test Cases ***
Repro
${caps} Create Dictionary javascriptEnabled=${True}
Open Browser https://www.google.com desired_capabilities=${caps}
Error messages and additional information
Starting test: SL-bug.DesiredCapabilitiesBug.Repro
20190102 14:57:16.375 : TRACE : Arguments: [ 'javascriptEnabled=${True}' ]
20190102 14:57:16.376 : TRACE : Return: {'javascriptEnabled': True}
20190102 14:57:16.376 : INFO : ${caps} = {u'javascriptEnabled': True}
20190102 14:57:16.377 : TRACE : Arguments: [ 'https://www.google.com' | desired_capabilities={'javascriptEnabled': True} ]
20190102 14:57:16.377 : INFO : Opening browser 'firefox' to base url 'https://www.google.com'.
20190102 14:57:16.379 : TRACE : Arguments: [ ]
20190102 14:57:16.380 : INFO : Cannot capture screenshot because no browser is open.
20190102 14:57:16.380 : TRACE : Return: None
20190102 14:57:16.382 : FAIL : TypeError: __init__() got an unexpected keyword argument 'javascriptEnabled'
20190102 14:57:16.382 : DEBUG : Traceback (most recent call last):
File "/ws/SL-bug/venv/lib/python2.7/site-packages/SeleniumLibrary/__init__.py", line 372, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "/ws/SL-bug/venv/lib/python2.7/site-packages/SeleniumLibrary/base/robotlibcore.py", line 102, in run_keyword
return self.keywords[name](*args, **kwargs)
File "/ws/SL-bug/venv/lib/python2.7/site-packages/SeleniumLibrary/keywords/browsermanagement.py", line 131, in open_browser
ff_profile_dir, remote_url)
File "/ws/SL-bug/venv/lib/python2.7/site-packages/SeleniumLibrary/keywords/browsermanagement.py", line 456, in _make_driver
remote_url=remote, profile_dir=profile_dir)
File "/ws/SL-bug/venv/lib/python2.7/site-packages/SeleniumLibrary/keywords/webdrivertools.py", line 58, in create_driver
profile_dir)
File "/ws/SL-bug/venv/lib/python2.7/site-packages/SeleniumLibrary/keywords/webdrivertools.py", line 109, in create_firefox
**desired_capabilities)
Ending test: SL-bug.DesiredCapabilitiesBug.Repro
Expected behavior and actual behavior
When I follow those steps, keyword fails
I was expecting browser to open
Environment
Browser: Any Browser driver: Any Operating System: macOS 10.13.2 Libraries
- Robot Framework: 3.1
- Selenium: 3.141.0
- SeleniumLibrary: 3.3.0
- Interpreter: CPython 2.7.15
This was be caused by https://github.com/robotframework/SeleniumLibrary/commit/159206fbe62b7189f893f5e4d60b47eaacd4b700#diff-566132cdf5a534d7e99598e5acc77378. _parse_capabilities
returns the capabilities as is when they are dict. But it needs to return keyword args as it does for string type desired capabilities or Falsey desired capabilities.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Unable to set desired capabilities when calling Open Browser ...
I am unable to call the keyword Open Browser when specifying desired capabilities for IE. I'm not sure if its a syntax issue, ......
Read more >Test different browser locales in Chrome with Desired ...
Test different browser locales in Chrome with Desired Capabilities. Chrome sets a default UI language with the first Chrome window that opens.
Read more >selenium/webdriver/remote/webdriver.py - external/selenium/py
desired_capabilities - Dictionary holding predefined values for starting a browser. - browser_profile - A selenium.webdriver.firefox.firefox_profile.
Read more >Help with Selenium2Library's "create webdriver" keyword and ...
I'm not able to specify a URL when using the "remote" driver. My keyword looks like this: *** Keywords ***. open app. ${capabilities}=...
Read more >Capabilities and EdgeOptions - Microsoft Edge Development
List of command-line arguments that WebView2 will pass to the browser process on launch. Arguments with an associated value should be separated ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks so much for the quick turnaround. I did
pip install git+https://github.com/robotframework/SeleniumLibrary.git
. Then I changed the test such that it requires the caps to work (go to site behind a proxy).Worked like a charm.
This issue should be fixed now in the master branch. @ombre42 could install from master and try it out? I will make hotfix release, but would like to wait few days so that more people have time to try 3.3.0 out and discover other possible regression bugs.