Invalid selectors should return error when finding multiple elements

RESOLVED FIXED

Status

Testing
Marionette
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: ato, Unassigned)

Tracking

(Blocks: 1 bug, {ateam-marionette-server})

Version 3
ateam-marionette-server
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

2 years ago
Currently the following assertion is true in Marionette:

    els = find_elements("anon", None)
    assert els == []

This passes in an invalid selector expression and returns an empty set, unlike the singular find element call, which returns an InvalidSelectorError instead:

    find_element("anon", None)

I would expect invalid selector expressions to always return an error, irregardless whether you use the singular or multiple find element command.
(Reporter)

Updated

2 years ago
Blocks: 721859
Keywords: ateam-marionette-server

Comment 1

a year ago
Appears to be fixed:

```
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

caps = DesiredCapabilities.FIREFOX

caps["marionette"] = True
caps["binary"] = "/Applications/Firefox48.app/Contents/MacOS/firefox-bin"

ff = webdriver.Firefox(capabilities=caps)
ff.get("https://google.com/")

ff_the_internet = ff.find_elements("anon", "")
```


WebDriverException: Message: Unknown locator strategy anon


Environment:

OS X, El Capitan
Firefox: 48.0
Selenium Standalone Server: 2.53.1
GeckoDriver: 0.9.0
Python: 2.7.12
Python, selenium: 2.53.6
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.