Revert "make label location strategy work with unescaped strings"
This reverts commit 4daf037146
.
This was causing failures in the Weplay selenium suite, where we
we're using partial matches. For example:
fill_in "Write a message", ...
When the markup was:
<label>Write a message to Bryan ...</label>
This commit is contained in:
parent
b4ae28c48c
commit
9a42304513
@ -1,7 +1,8 @@
|
|||||||
var allLabels = inDocument.getElementsByTagName("label");
|
var allLabels = inDocument.getElementsByTagName("label");
|
||||||
var candidateLabels = $A(allLabels).select(function(candidateLabel){
|
var candidateLabels = $A(allLabels).select(function(candidateLabel){
|
||||||
|
var regExp = new RegExp('^' + locator + '\\b', 'i');
|
||||||
var labelText = getText(candidateLabel).strip();
|
var labelText = getText(candidateLabel).strip();
|
||||||
return labelText.toLowerCase() == locator.toLowerCase();
|
return (labelText.search(regExp) >= 0);
|
||||||
});
|
});
|
||||||
if (candidateLabels.length == 0) {
|
if (candidateLabels.length == 0) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user