Ugh
1. better understanding
Thanks from the pointer, I did read
w3schools.com [1] and I think
that I did get better understanding.
2. Correct selector
The syntax is not correct if I try: css=p:contains['Wind'] and I get
same error: WebDriverException: Message: u'An invalid or illegal
string was specified'
And the trace implies that webdriver does not understand my request:
Traceback (most recent call last):
File "<string>", line 2, in click_element
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/keywordgroup.py",
line 12, in _run_on_failure_decorator
return method(*args, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/_element.py",
line 254, in click_element
self._element_find(locator, True, True).click()
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/_element.py",
line 520, in _element_find
elements = self._element_finder.find(browser, locator, tag)
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/locators/elementfinder.py",
line 27, in find
return strategy(browser, criteria, tag, constraints)
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/locators/elementfinder.py",
line 66, in _find_by_css_selector
browser.find_elements_by_css_selector(criteria),
File
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
line 369, in find_elements_by_css_selector
return self.find_elements(by=By.CSS_SELECTOR,
value=css_selector)
File
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
line 684, in find_elements
{'using': by, 'value': value})['value']
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/webdrivermonkeypatches.py",
line 11, in execute
result = self._base_execute(driver_command, params)
File
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py",
line 156, in execute
self.error_handler.check_response(response)
File
"/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py",
line 147, in check_response
raise exception_class(message, screen, stacktrace)
If I try css=p#Wind it does not find the element. Error message is:
ValueError: Element locator 'css=p#Wind' did not match any elements.
The trace implies that error is coming from Selenium2library:
Traceback (most recent call last):
File "<string>", line 2, in click_element
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/keywordgroup.py",
line 12, in _run_on_failure_decorator
return method(*args, **kwargs)
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/_element.py",
line 254, in click_element
self._element_find(locator, True, True).click()
File
"/usr/local/lib/python2.7/dist-packages/Selenium2Library/keywords/_element.py",
line 522, in _element_find
raise ValueError("Element locator '" + locator + "' did not
match any elements.")
-Tatu
[1]
http://www.w3schools.com/cssref/css_selectors.asp