Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
make label location strategy work with unescaped strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Jack committed Jun 2, 2009
1 parent 2ae14f7 commit 4daf037
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/webrat/selenium/location_strategy_javascript/label.js
@@ -1,8 +1,7 @@
var allLabels = inDocument.getElementsByTagName("label");
var candidateLabels = $A(allLabels).select(function(candidateLabel){
var regExp = new RegExp('^' + locator + '\\b', 'i');
var labelText = getText(candidateLabel).strip();
return (labelText.search(regExp) >= 0);
return labelText.toLowerCase() == locator.toLowerCase();
});
if (candidateLabels.length == 0) {
return null;
Expand Down

0 comments on commit 4daf037

Please sign in to comment.