Issue Details (XML | Word | Printable)

Key: SEL-398
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Colin Young
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Selenium

Upgrade xpath.js to latest version of AJAXSLT

Created: 07/Dec/06 02:29 PM   Updated: 05/Feb/08 04:37 PM   Resolved: 18/Nov/07 12:29 AM
Component/s: BrowserBot-IE, XPath
Affects Version/s: 0.8.1
Fix Version/s: 1.0

File Attachments: 1. Zip Archive xpath-0.7.zip (24 kB) 08/Feb/07 11:35 AM - Andrey Yegorov

Environment: IE6


 Description  « Hide

Certain XPaths (those using ancestor-or-self, ancestor, following-sibling, preceding-sibling) cause an infinite loop in IE. The bug exists in the xpath.js file. The author of that file has been notified and fixed the issue; you can get the update from http://code.google.com/p/ajaxslt/



Sort Order: Ascending order - Click to sort in descending order
Dave Hanna added a comment - 12/Dec/06 02:40 PM

I have found the bug if you want the solution. I commented out the offending line and updated

} else if (this.axis == xpathAxis.PRECEDING_SIBLING) {
//This is the worst ever
//for (var n = input.previousSibling; n; n = input.previousSibling) {
for (var n = input.previousSibling; n; n = n.previousSibling) { nodelist.push(n); }


Colin Young added a comment - 13/Dec/06 07:55 AM

Actually, there are a total of 4 places with the problem (I only managed to find them because of the information you provided in your original forum post). They are at lines 655, 660, 686 and 707.


Colin Young added a comment - 18/Dec/06 08:18 AM

Google has released an updated xpath.js with this fix incorporated: http://ajaxslt.googlecode.com/svn/tags/release-0-6/


Andrey Yegorov added a comment - 08/Feb/07 11:34 AM

I downloaded google's ajaxslt 0.7 from http://code.google.com/p/ajaxslt/downloads/list , took necessary files and merged in the fix by Patrick Lightbody to allow node selection to be case-insensitive.

It works like a charm with selenium 0.8.0. Xpathes for /parent or /preceding-sibling no longer hang.
other expressions looks to be resolved slightly faster.

I attached archive with code necessary.
Just replace current xpath libraries with those (backup old ones just in case) and include new javascript files in teh testrnner.html


Andrey Yegorov added a comment - 08/Feb/07 11:35 AM

xpath 0.7 taht resolves hangs on searches for /parent etc. elements


Colin Young added a comment - 22/Feb/07 01:42 PM

xpath 0.7 breaks selenium in IE for me. I get XML_NC_NAME not found. FireFox is fine however.


Andrey Yegorov added a comment - 26/Feb/07 10:48 AM

Colin,

you need to update testrunner.html (if you are using s-core) or other corresponding file ( if you are using s-ide, or hta, or something else)
see http://forums.openqa.org/thread.jspa?threadID=6483&tstart=15&start=0


Dan Fabulich added a comment - 25/Oct/07 12:01 PM

We've submitted some important patches back to AJAXSLT that don't appear in version 0.7. mesch said that he expects a new version to be released real soon now; we should upgrade to that instead of to 0.7.


Dan Fabulich added a comment - 18/Nov/07 12:29 AM

core revision 1919