jsxGet_frames falls over with a ClassCast exception on some usages. Patch is
public HTMLCollection jsxGet_frames() {
if (frames_ == null) {
final XPath xpath;
try {
xpath = new HtmlUnitXPath("//*[(name() = 'frame' or name() = 'iframe')]");
}
catch (final JaxenException e) {
// should never occur
throw Context.reportRuntimeError("Failed initializing frame collections: " + e.getMessage());
}
final HtmlPage page = (HtmlPage) getWebWindow().getEnclosedPage();
frames_ = new HTMLCollection(this);
final Transformer toEnclosedWindow = new Transformer() {
public Object transform(final Object obj) {
if (obj instanceof BaseFrame)
return ((BaseFrame) obj).getEnclosedWindow();
else
return ((FrameWindow)obj).getFrameElement().getEnclosedWindow();
}
};
frames_.init(page, xpath, toEnclosedWindow);
}
return frames_;
}
Logged In: YES
user_id=950730
Originator: NO
Dear Simon,
Thanks for the information, but could you submit a test case that fails please?
Logged In: YES
user_id=950730
Originator: NO
Pending requester information.
Please provide a failing case.
Many thanks.
Logged In: YES
user_id=950730
Originator: NO
Please note this is similar to http://sourceforge.net/tracker/index.php?func=detail&aid=1802836&group_id=47038&atid=448266, which is now fixed.