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
{{ message }}
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
When a selector that we expect to match exactly one element matches multiple I want that to be an error instead of a warning to ensure the test author notices it.
Can we allow that to be configurable? Here is the code from element.js:
var getWebElements = function() {
return elementArrayFinder.getWebElements().then(function(webElements) {
if (webElements.length === 0) {
throw new webdriver.error.Error(
webdriver.error.ErrorCode.NO_SUCH_ELEMENT,
'No element found using locator: ' +
elementArrayFinder.locator_.toString());
} else {
if (webElements.length > 1) {
log.warn('more than one element found for locator ' +
elementArrayFinder.locator_.toString() +
' - the first result will be used');
}
return [webElements[0]];
}
});
};