On Saturday 08 July 2006 10:39, Julien HENRY wrote:
> In fact, it's how HtmlUnit works. You have to manipulate a great number of
> variable: WebClient wc = new WebClient();
> HtmlPage myPage = wc.getPage("www.google.fr");
> HtmlForm form = (HtmlForm) myPage.getForms().get(0);
> ...
>
> And the code become totally unreadable (there are also a lot of try..catch
> blocks). That's why jWebUnit was created. You don't need to manipulate
> variables. The current state is stored and you navigate in windows, frames
> and forms: gotoPage("www.google.fr"); // The current page become
> www.google.fr setCurrentForm(0); // The current form become 1rst form in
> current page assertSubmitButtonPresent(); // Assert there is a submit
> button in the current form
>
> The problem with manipulating objects with jWebUnit is that these objects
> should be independent of the plugins.Ok ! Got it... I didn't know that HtmlForm was from htmlunit. I never used htmlunit. So, ok, it's not a good idea to mix objects from the plugin into the core library. > Consequently, we would have to write > a new layer, and it's very difficult. > An example is html tables. Currently, > we can get a jWebUnit object called Table from the plugin, but I don't > think it's the best solution. Indeed, this object only store text content, > colspan and rowspan of each cells. A recent feature request was to assert a > link is present in a given cell. With the current Table object, it's not > possible. Yes, indeed. What I did is a combination of assertTableEquals() and assertLinkPresentWithText().. But this is not enough to validate that the link is in the table, in the right cell. > Perhaps should we refactor the API to have the same logic as windows, > frames or forms: setCurrentTable(String tableNameSummaryOrId) > setCurrentCell(int row, int col); Yep, probably something identical. I have to take some time to dig into the code to get a better understanding of how it works. > ++ > Julien Fred. *DISCLAIMER* This e-mail (including any attachments) may contain information which is privileged or confidential or constitute non-public information.It is to be conveyed only to the intended recipient(s).If you received this e-mail in error, please notify the sender immediately by e-mail or telephone and delete the e-mail from your system without reading, copying or disclosing its contents to any other person. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Jwebunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jwebunit-users
