You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Javascript an expression (eg. 1 + 1) and a statement (eg. const a = 1 + 1; or return a;) are different things, but the documentation for By.js refers to it requiring an "expression" when it actually requires a statement (specifically a return statement).
🐛 Bug Report
In Javascript an expression (eg.
1 + 1
) and a statement (eg.const a = 1 + 1;
orreturn a;
) are different things, but the documentation for By.js refers to it requiring an "expression" when it actually requires a statement (specifically areturn
statement).To Reproduce
TypeError: Custom locator did not return a WebElement
return *whatever expression you had before*
Expected behavior
The documentation should be changed from:
to:
Arguably a much better solution would be to make this function actually expect an expression. There's really no reason to make devs provide:
when they could just provide:
... but I'm guessing it's easier to avoid breaking things by just fixing the documentation :)
OS: Any
Browser:Any
Browser version: Any
Browser Driver version: Current (documentation for version at https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/by_exports_By.html#By.js)
Language Bindings version: Javascript
Selenium Grid version (if applicable): n/a
The text was updated successfully, but these errors were encountered: