Closed Bug 1254486 Opened 8 years ago Closed 8 years ago

Invalid selectors should return error when finding multiple elements

Categories

(Remote Protocol :: Marionette, defect)

Version 3
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ato, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: pi-marionette-server)

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.
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
Closed: 8 years ago
Resolution: --- → FIXED
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.