'--lang=xx' to Chrome webdriver?
I have made this keyword:
| Open URL in Google Chrome | [Arguments] | ${url}
| | [Documentation] | Starts the Google Chrome browser.
| | ${options}= | Evaluate | sys.modules['selenium.webdriver'].ChromeOptions() | sys, selenium.webdriver
| | Call Method | ${options} | add_argument | --lang=de
| | Create WebDriver | Chrome | chrome_options=${options}
| | Go To | ${url}
When I use this keyword I get this error:
TRACE: Arguments: [ <selenium.webdriver.chrome.options.Options object at 0x03307270> | 'add_argument' | --lang='de' ]
FAIL: Calling method 'add_argument' failed: TypeError: add_argument() got an unexpected keyword argument '--lang'
from selenium import webdriver
lang_de = webdriver.ChromeOptions()
lang_de.add_argument("--lang=de")
chrome = webdriver.Chrome(chrome_options=lang_de)
| Open URL in Google Chrome | [Arguments] | ${url}
| | [Documentation] | Starts the Google Chrome browser.
| | ${options}= | Evaluate | sys.modules['selenium.webdriver'].ChromeOptions() | sys
| | Call Method | ${options} | add_argument | --lang\=de
| | Create WebDriver | Chrome | chrome_options=${options}
| | Go To | ${url}
--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.
Ugh
That would be nice example to the keyword documentation.
-Tatu
Send from my mobile
Ugh
Did open a issue [1], so that we actually remember to decide and perhaps implemented the improvement.
-Tatu
Send from my mobile
[1] https://github.com/robotframework/Selenium2Library/issues/529
from selenium import webdriver
lang_de = webdriver.ChromeOptions()
lang_de.add_argument("--lang=de")
chrome = webdriver.Chrome(chrome_options=lang_de)
chrome.get("http://www.google.com")
search_input = chrome.find_element_by_xpath("//input[@class='gsfi']")
search_input.send_keys("I love Python!")
search_button = chrome.find_element_by_xpath("//button[@class='lsb']")
search_button.click()
FAIL: Calling method 'add_argument' failed: TypeError: add_argument() got an unexpected keyword argument.
Thanks for posting!