Author: vrockai
Date: 2009-04-02 10:38:44 -0400 (Thu, 02 Apr 2009)
New Revision: 13117
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/selenium-rc-server/user-extensions.js
Log:
[selenium] - new version of extension; finding in table fix
Modified:
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/selenium-rc-server/user-extensions.js
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/selenium-rc-server/user-extensions.js 2009-04-02
13:55:10 UTC (rev 13116)
+++
branches/Enterprise_Portal_Platform_4_3/testsuite/ui-tests/selenium-rc-server/user-extensions.js 2009-04-02
14:38:44 UTC (rev 13117)
@@ -7,23 +7,24 @@
for (rowNo=0; rowNo<rowObj.length; rowNo++) {
// No need to read too short rows
var maxCol = rowObj[rowNo].cells.length;
- if (maxCol <= searchCol || maxCol <= minCol) {continue;}
- ///alert("1" + searchText);
- // Read the content of the search colomn
+
+ if (maxCol <= searchCol || maxCol <= minCol)
+ continue;
+
searchHtml = rowObj[rowNo].cells[searchCol].innerHTML;
- //alert("2"+searchHtml);
- // Let's ignore <TD> inside <TD>s.
- // Due to some odd reasons 'm' switch does not work in 'match'
- // - Sumith (10th Dec, 2006)
- if (searchHtml.replace(/\n/g, "
").match(/<TD.*>.*<\/TD>/i)) continue;
- ///alert("3"+searchHtml);
+ searchHtml = searchHtml.replace(/(<([^>]+)>)/ig,"");
+
+ //alert(searchHtml);
+ //if (searchHtml.replace(/\n/g, "
").match(/<TD.*>.*<\/TD>/i))
+ // continue;
+
// Build the pattern to check search column
var searchPat = new RegExp(".*"+searchText+".*",
"m");
- //var searchPat = new
RegExp("^(.*<[^<>]*>)?\\s*"+searchText+"\\s*(<[^<>]*>.*)?$",
"m");
-
//alert("4"+"|"+searchText+"|"+searchHtml+"|");
+
// No more processing for unmatched rows
- if (!searchHtml.match(searchPat)) {continue;}
-
//alert("5"+"|"+searchText+"|"+searchHtml+"|");
+ if (!searchHtml.match(searchPat))
+ continue;
+
// Got the row! Let's simply return it
return rowNo;
}
Show replies by date