Hi Roland, Can we have a small test case that returns such a 'page', and we can check how real browsers manipulates it. And then fix HtmlUnit/WebTest accordingly.
Yours, Ahmed---- Blog: http://asashour.blogspot.com ________________________________ From: "Wuerth, Roland" <[email protected]> To: [email protected]; Marc Guillemot <[email protected]> Sent: Wed, October 14, 2009 2:09:09 PM Subject: AW: AW: [Webtest] ClassCastException when clickingRichFaces-Button Hallo Marc, I don't fully understand it either :-( But when I look into the stack-trace beginning at the second "caused by" I can see that HtmlUnit gets the resonseXML and constructs an XmlPage. Then a HtmlInlineFrame is constructed and WebClient.getPage() is called to WebClient.loadWebResponseInto()...into the XmlPage? A WindowContentChanged-Event is fired, which is consumed by Webtests WebClientContext$CurrentWindowTracker.webWindowContentChanged(), which calls HtmlUnits FrameWindow.getEnclosingPage(). Here the point where the page is casted into an HtmlPage, which leads to the ClassCastException because it is an XmlPage. Maybe Webtest should use getParentWindow().getEnclosedPage instead an test, if it is an HtmlPage before casting? Or HtmlUnit is wrong in constructing an XmlPage? I admit, I am confused... Roland Würth (IT-Frankfurt) Programm KonzernPerson - KP-FE/SL Raum GH 02.45.096, Theodor-Heuss-Allee 80, D-60486 Frankfurt Tel: +49 - 69 136 49668 mailto:[email protected] -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von Marc Guillemot Gesendet: Mittwoch, 14. Oktober 2009 11:36 An: [email protected] Betreff: Re: AW: [Webtest] ClassCastException when clickingRichFaces-Button Hallo Roland, > > I don't have a clue which function they have in the > RichFaces-Component, but while Webtest (and HtmlUnit) tries to load > the XMLHttpRequest.responseXML into the iFrame it assumes that it is > HTML and constructs an HtmlPage while it should construct an XmlPage. > Even after we patched this, Webtest tries to invoke javascript and the next > Exception is thrown. it seems that it is the root of the problem... but I don't fully understand what you mean :-( For what should WebTest construct an XmlPage? Cheers, Marc. _______________________________________________ WebTest mailing list [email protected] http://lists.canoo.com/mailman/listinfo/webtest _______________________________________________ WebTest mailing list [email protected] http://lists.canoo.com/mailman/listinfo/webtest

