Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit bf26f76

Browse files
committed
fix(locators): findind elements by text should trim whitespace
WebDriver always trims whitespace from around the text of an element, so to be consistent we should trim the text from button elements before doing a by.buttonText. Closes #903, Closes #904.
1 parent 6906c93 commit bf26f76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/clientsidescripts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ functions.findByButtonText = function(searchText, using) {
389389
} else {
390390
elementText = element.value;
391391
}
392-
if (elementText === searchText) {
392+
if (elementText.trim() === searchText) {
393393
matches.push(element);
394394
}
395395
}

0 commit comments

Comments
 (0)