Skip to content

findByClassName(), findAllByClassName() throws "invalid locator" error #1107

Open
@wkeese

Description

@wkeese

Expected behavior

findAllByClassName() should return a list of elements.

Current behavior

It returns an "Invalid argument" error:

InvalidArgument: [POST http://.../elements / {"using":"class name","value":"usernameInput"}] invalid argument: invalid locator

Possible solution

I thought this was a bug in Edgium's driver, but after reading https://www.w3.org/TR/webdriver/#find-element and then https://www.w3.org/TR/webdriver/#dfn-table-of-location-strategies, it seems that "class name" is not a valid strategy.

You could easily convert a call of getAllByClassName("foo") to getAllByCssSelector(".foo").

Environment

Intern version: 4.5.0
Node version: 10.15.3
NPM version: 6.13.7
Browser version: MS Edge Chromium 80

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intendeddomain-webdriverRelated to Intern's webdriver interface (formerly Leadfoot)effort-mediumThis may take a couple of dayspriority-highMost importantrepo-leadfootResolution applies to @theintern/leadfoot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions