Skip to content

When EventFiringWebDriver is enabled, elements from Get WebElement(s) keywords are not recoginized as instance of WebElement  #1538

@rasjani

Description

@rasjani

Steps To Reproduce:

Short Example
  ${elem}=   Get WebElement    id:shorttimeout-result
  Wait Until Element Contains    ${elem}    not executed

elem variable here is then passed internally to SeleniumLibrary's element_finder which checks if it is already a WebElement and if its not, then tries to identify if its a locator of sorts. This causes following crash:

Traceback (most recent call last):
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\__init__.py", line 467, in run_keyword
    return DynamicCore.run_keyword(self, name, args, kwargs)
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\base\robotlibcore.py", line 102, in run_keyword
    return self.keywords[name](*args, **kwargs)
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\keywords\waiting.py", line 237, in wait_until_element_contains
    timeout, error
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\keywords\waiting.py", line 264, in _wait_until
    self._wait_until_worker(condition, timeout, error)
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\keywords\waiting.py", line 271, in _wait_until_worker
    if condition():
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\keywords\waiting.py", line 235, in <lambda>
    lambda: text in self.find_element(locator).text,
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\base\context.py", line 74, in find_element
    return self.element_finder.find(locator, tag, True, required, parent)
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\locators\elementfinder.py", line 69, in find
    prefix, criteria = self._parse_locator(locator)
  File "D:\omat\seleniumtestability\venv\lib\site-packages\SeleniumLibrary\locators\elementfinder.py", line 236, in _parse_locator
    if locator.startswith(('//', '(//')):
  File "D:\omat\seleniumtestability\venv\lib\site-packages\selenium\webdriver\support\event_firing_webdriver.py", line 318, in __getattr__
    attrib = getattr(self._webelement, name)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions