click_link matches anchor id's with Selenium

This commit is contained in:
Larry Diehl 2009-05-28 23:23:09 -07:00
parent 627913708c
commit 4d05a2cf2b
1 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
var links = inDocument.getElementsByTagName('a');
var candidateLinks = $A(links).select(function(candidateLink) {
return PatternMatcher.matches(locator, getText(candidateLink));
var textMatched = PatternMatcher.matches(locator, getText(candidateLink));
var idMatched = PatternMatcher.matches(locator, candidateLink.id);
return textMatched || idMatched;
});
if (candidateLinks.length == 0) {
return null;