make label location strategy work with unescaped strings
This commit is contained in:
parent
2ae14f78b1
commit
4daf037146
|
@ -1,8 +1,7 @@
|
||||||
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.search(regExp) >= 0);
|
return labelText.toLowerCase() == locator.toLowerCase();
|
||||||
});
|
});
|
||||||
if (candidateLabels.length == 0) {
|
if (candidateLabels.length == 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue