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
desired_capabilities doesn't appear to work for local WebDrivers #139
Right after posting this, I saw that a 2.26.0 version of selenium was
posted and it appears they re-added desired capabilities. So it's possible
it'll work again if people upgrade to this. I haven't had a chance to try
yet because I'm having trouble upgrading to 2.26.0
Chrome's just gotta be different doesn't it. :) Thanks for pointing this
out. We'll have to rework the Open Browser code.
Cheers,
Jeremy
On Nov 2, 2012, at 5:09 AM, lesliepc16 wrote:
It doesn't look like the desired capabilities flag is working when
opening a chrome browser. I think it might be related to this change in the
selenium library.
well desired capabilities should be a dictionary. So I don't think that --enable-logging: is the correct syntax. It's probably something like enable-logging:True. I'll have a go when I get back to my normal machine on Monday and let you know if it works for me.
Cheers,
Jeremy
On Nov 3, 2012, at 4:53 AM, lesliepc16 wrote:
Not sure if I'm doing something wrong, but after upgrading to 2.26.0 this still isn't working for me.
I couldn't find any good documentation on how to pass this, but skimming this it seemed like the dictionary would correspond to the chrome command line switches: http://code.google.com/p/selenium/wiki/ChromeDriver
By looking at the code, I don't think selenium2library is currently able to send this desired_capability configuration object to Selenium, because it is limited to simple string-only key-value-pairs.
Because Robot Framework has support for dictionaries and lists, I'd propose to let desired_capabilities to also accept real dictonaries in addition to the special-formatted strings like it is implemented right now (should also be backwards compatible):
*** Settings ***
Library Collections
*** Test Cases ***
Complex Desired Capabilities Should Work
${chrome_switches} = Create List enable-logging v=1
${desired_capabilities} = Create Dictionary chrome.switches ${chrome_switches} platform WINDOWS
Open Browser *googlechrome desired_capabilities=${desired_capabilities}
Makes sense to me. Will we need to do something rethinking of the whole thing anyways cause the Chrome boys are depreciating desired capabilities altogether.... So much for standardization. :(
{"--enable-logging": "", "--v": "1"}
However, what you want is setting the capability "chrome.switches" to the Value ["enable-logging", "v=1"](values Chrome accepts here are documented at https://code.google.com/p/chromedriver/wiki/CapabilitiesAndSwitches), so selenium2library should send
{"chrome.switches": ["enable-logging", "v=1"]}
to Selenium.
By looking at the code, I don't think selenium2library is currently able to send this desired_capability configuration object to Selenium, because it is limited to simple string-only key-value-pairs.
Because Robot Framework has support for dictionaries and lists, I'd propose to let desired_capabilities to also accept real dictonaries in addition to the special-formatted strings like it is implemented right now (should also be backwards compatible):
*** Settings ***
Library Collections
*** Test Cases ***
Complex Desired Capabilities Should Work
${chrome_switches} = Create List enable-logging v=1
${desired_capabilities} = Create Dictionary chrome.switches ${chrome_switches} platform WINDOWS
Open Browser *googlechrome desired_capabilities=${desired_capabilities}
.. how about that ?
—
Reply to this email directly or view it on GitHub.
U believe I saw it in the code itself, but I can't remember for sure. I checked the docs page and it doesn't say anything about getting rid of desired capabilities. So perhaps I'm being a bit premature. However the new one us called ChromeOptions and functions similar to desired capabilities. You might want to google a bit. Sorry I can't be more helpful but I'm a bit limited being that I'm on my phone right now.
changed the title [-]Desired Capabilities doesn't appear to work[/-][+]desired_capabilities doesn't appear to work for local WebDrivers[/+]on Aug 29, 2014
Activity
j1z0 commentedon Nov 2, 2012
Chrome's just gotta be different doesn't it. :) Thanks for pointing this out. We'll have to rework the Open Browser code.
Cheers,
Jeremy
On Nov 2, 2012, at 5:09 AM, lesliepc16 wrote:
lesliepc16 commentedon Nov 2, 2012
Hey Jeremy,
Right after posting this, I saw that a 2.26.0 version of selenium was
posted and it appears they re-added desired capabilities. So it's possible
it'll work again if people upgrade to this. I haven't had a chance to try
yet because I'm having trouble upgrading to 2.26.0
http://code.google.com/p/selenium/source/browse/trunk/py/selenium/webdriver/chrome/webdriver.py
http://code.google.com/p/selenium/source/detail?r=17953&path=/trunk/py/selenium/webdriver/chrome/webdriver.py
-L
On Thu, Nov 1, 2012 at 8:31 PM, Jeremy Johnson notifications@github.life-white.ukwrote:
j1z0 commentedon Nov 2, 2012
ahh ok, let me know the outcome if / when you get a chance to upgrade. If it works we will just have to change the setup dependencies to be >= 2.26.0
lesliepc16 commentedon Nov 2, 2012
Not sure if I'm doing something wrong, but after upgrading to 2.26.0 this still isn't working for me.
Ran a simple test case:
(Note github is stripping out some of my extra spaces that I have between args and stuff so I added dots.)
_Settings_
Library.....Selenium2Library
_Test Cases_
Start Chrome
.....Start Chrome
_Keywords_
Start Chrome.....Open browser.....http://www.google.com.....browser=Chrome.....desired_capabilities=--enable-logging:
Then in the log I don't see the desired capabilities.
13:44:07.235 TRACE Arguments: [ u'http://www.google.com' | desired_capabilities=u'--enable-logging:' | browser=u'Chrome' ]
13:44:07.235 INFO Opening browser 'Chrome' to base url 'http://www.google.com'
13:44:08.241 DEBUG POST http://127.0.0.1:51201/session {"sessionId": null, "desiredCapabilities": {"platform": "ANY", "browserName": "chrome", "version": "", "javascriptEnabled": true, "chromeOptions": {"binary": "", "args": [], "extensions": []}}}
j1z0 commentedon Nov 3, 2012
well desired capabilities should be a dictionary. So I don't think that --enable-logging: is the correct syntax. It's probably something like enable-logging:True. I'll have a go when I get back to my normal machine on Monday and let you know if it works for me.
Cheers,
Jeremy
On Nov 3, 2012, at 4:53 AM, lesliepc16 wrote:
lesliepc16 commentedon Nov 6, 2012
Hey Jeremy,
I couldn't find any good documentation on how to pass this, but skimming this it seemed like the dictionary would correspond to the chrome command line switches:
http://code.google.com/p/selenium/wiki/ChromeDriver
peritus commentedon Jan 28, 2013
Here's what I think happens:
You pass
and selenium2library parses that to the JSON (in https://github.com/rtomac/robotframework-selenium2library/blob/master/src/Selenium2Library/keywords/_browsermanagement.py#L463) that is then send to Selenium:
However, what you want is setting the capability
"chrome.switches"to the Value["enable-logging", "v=1"](values Chrome accepts here are documented at https://code.google.com/p/chromedriver/wiki/CapabilitiesAndSwitches), so selenium2library should sendto Selenium.
By looking at the code, I don't think selenium2library is currently able to send this desired_capability configuration object to Selenium, because it is limited to simple string-only key-value-pairs.
Because Robot Framework has support for dictionaries and lists, I'd propose to let desired_capabilities to also accept real dictonaries in addition to the special-formatted strings like it is implemented right now (should also be backwards compatible):
.. how about that ?
j1z0 commentedon Jan 29, 2013
Makes sense to me. Will we need to do something rethinking of the whole thing anyways cause the Chrome boys are depreciating desired capabilities altogether.... So much for standardization. :(
Cheers,
Jeremy
On Jan 28, 2013, at 21:00, Filip Noetzel notifications@github.com wrote:
peritus commentedon Jan 29, 2013
@j1z0 Do you have a pointer to some wiki page / mailing list discussion about the deprecation plans ?
I think I'll get around to a pull request implementing my proposal in the next days, so we at least have something that works until it's deprecated.
Allow desired_capabilities= to be a dictionary
j1z0 commentedon Jan 31, 2013
U believe I saw it in the code itself, but I can't remember for sure. I checked the docs page and it doesn't say anything about getting rid of desired capabilities. So perhaps I'm being a bit premature. However the new one us called ChromeOptions and functions similar to desired capabilities. You might want to google a bit. Sorry I can't be more helpful but I'm a bit limited being that I'm on my phone right now.
Cheers,
Jeremy
On Jan 29, 2013, at 19:21, Filip Noetzel notifications@github.com wrote:
[-]Desired Capabilities doesn't appear to work[/-][+]desired_capabilities doesn't appear to work for local WebDrivers[/+]aaltat commentedon Nov 5, 2015
I think this is now possible with the Create Webdriver keyword. If you think that this is still an issue, please open a new issue.