Bugs item #3166502, was opened at 2011-01-27 13:05
Message generated for change (Comment added) 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 3.0
>Status: Closed
>Resolution: Fixed
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.
----------------------------------------------------------------------
>Comment By: Julien HENRY (henryju)
Date: 2011-01-27 14:05
Message:
Good catch. This code was not tested because no exposed method was using
it. As a result I decided to add 3 new "indexed" methods:
clickLinkWithImage, assertLinkPresentWithImage and
assertLinkNotPresentWithImage
Thanks
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=3166502&group_id=61302
|