You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Browser Capabilities handling : need to fix boolean values for remote webdriver - need to use capabilities for local webdriver #342
Hi all,
On a webapp I have to use a popup only shown on mouse hover.
For this purpose I need to give the requireMouseFocus parameter in the capabilities for Internet Explorer. This works well in pure python/selenium.
Unfortunately when using robot and selenium2library (1.5.0) it makes the IEDriverServer.exe (2.43.0) crash violently
Boolean capabilities parsing
I found that the parsing in Selenium2Library::_BrowserManagementKeywords (_browsermanagement.py) needs a fix. Indeed boolean values are taken as string. My code fix suggestion is the following in _parse_capabilities_string :
for cap in capabilities_string.split(","):
(key, value) = cap.split(":", 1)
#TR
if value.strip().lower() == "true":
desired_capabilities[key.strip()] = True
elif value.strip().lower() == "false":
desired_capabilities[key.strip()] = False
else:
desired_capabilities[key.strip()] = value.strip()
#TR
Capabilities not taken into account for local use (related to Issue #139)
Unfortunatly this fix is not enough for local webdriver as capabilities are totally ignored then. To fix this I suggest also this fix in _generic_make_browser :
if not remote_url:
#TR
merged_caps = desired_cap_type.copy()
merged_caps.update(self._parse_capabilities_string(desired_caps))
browser = webdriver_type(capabilities=merged_caps)
#TR
If you confirm the two issues, is it possible to plan the fixes for the next release ?
The issue with booleans interpreted as strings was addressed in 1.3. You can pass in a real dict instead of a specially formatted string.
This is mentioned in the doc for Open Browser:
'desired_capabilities' can also be a dictonary (created with 'Create Dictionary') to allow for more complex configurations.
Hmmm... I think that could be improved by mentioning how it differs from when the argument is a string.
#139 is tagged future release. I'm not sure when it will get fixed, but it should be.
I think your best option is to use Create Webdriver.
There is an example there demonstrating how to pass arguments to the __init__ of IE's webdriver.
The solution to #139 isn't quite that simple. Some of the webdrivers have a capabilities argument and others have desired_capabilities.
There is some info and history in #245.
Hi Kevin,
Thank you for your answer and the proposed workaround for the booleans (Create dictionary). However I think it's is better to fix also the code so that the behaviour is the same when using a string and a real dictionary.
Ok for #139. Create Webdriver is an usable workaround before an acceptable way to fix the code is found.
There are other issues too...
proxy's value is a dict - this has been a problem for a lot of people and fixing that is not as simple as the bool issue.
int-type capabilities are being sent as strings - I'm assuming that is no good either.
We gladly accept patches with tests if you want to improve the string parsing.
There has not been activity for this issue for long time and we are planning to close the old issues if they are not anymore valid ones. If you feel that this is still valid issue, could you send an update. If update is not received in a month, we will assume that this is not anymore an issues and we will close this issue.
Activity
ombre42 commentedon Oct 10, 2014
The issue with booleans interpreted as strings was addressed in 1.3. You can pass in a real dict instead of a specially formatted string.
This is mentioned in the doc for Open Browser:
Hmmm... I think that could be improved by mentioning how it differs from when the argument is a string.
#139 is tagged future release. I'm not sure when it will get fixed, but it should be.
I think your best option is to use Create Webdriver.
There is an example there demonstrating how to pass arguments to the
__init__of IE's webdriver.The solution to #139 isn't quite that simple. Some of the webdrivers have a
capabilitiesargument and others havedesired_capabilities.There is some info and history in #245.
tramora commentedon Oct 13, 2014
Hi Kevin,
Thank you for your answer and the proposed workaround for the booleans (Create dictionary). However I think it's is better to fix also the code so that the behaviour is the same when using a string and a real dictionary.
Ok for #139. Create Webdriver is an usable workaround before an acceptable way to fix the code is found.
ombre42 commentedon Oct 13, 2014
There are other issues too...
proxy's value is a dict - this has been a problem for a lot of people and fixing that is not as simple as the bool issue.
int-type capabilities are being sent as strings - I'm assuming that is no good either.
We gladly accept patches with tests if you want to improve the string parsing.
aaltat commentedon May 23, 2016
There has not been activity for this issue for long time and we are planning to close the old issues if they are not anymore valid ones. If you feel that this is still valid issue, could you send an update. If update is not received in a month, we will assume that this is not anymore an issues and we will close this issue.
aaltat commentedon Sep 19, 2017
Closing due inactivity.