[JWebUnit-development] [ jwebunit-Bugs-3166502 ] Index bug in HtmlUnitTestingEngineImpl.getLinkWith
Brought to you by:
henryju
|
From: SourceForge.net <no...@so...> - 2011-01-27 12:32:09
|
Bugs item #3166502, was opened at 2011-01-27 13:05 Message generated for change (Settings changed) made by henryju You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3166502&group_id=61302 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: HtmlUnit plugin Group: Release 2.5 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Harri (n116373) >Assigned to: Julien HENRY (henryju) Summary: Index bug in HtmlUnitTestingEngineImpl.getLinkWithImage() Initial Comment: JWebUnit-htmlunit-plugin 2.4 and 2.5 versions have the following private method in HtmlUnitTestingEngineImpl private HtmlAnchor getLinkWithImage(String filename, int index) { return (HtmlAnchor) getHtmlElementByXPath("(//a[img[contains(@src,\"" + filename + "\")]])[" + index + 1 + "]"); } 'index + 1' part should have parenthesis around integers: (index + 1), as now this concatenates integers as Strings. Index=1 results [11] and index = 2 results [12]. Common case index=0 works as [01] by accident. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3166502&group_id=61302 |