From: Rares Portan/SPR/RO <rp...@sa...> - 2005-03-03 07:15:34
|
Hi, I have some objects kept in session, for example let say I have a LoginBean that has a username field. This object is updated when the form is submitted with the username entered by user in the textfield. And the bean is then used by the middlelayer to get the username. This data is not saved in the database, is just kept in session to identify the user. What I want is to compare the bean.getUsername() value with the value set in the textfield. This is just an example, the problem is that I have some session objects that are updated all the time based on user actions and I feel that I can't make complete tests for my application without testing them. HtmlForm form=.. HtmlInput username=.. String newValue="MyNewValue"; //update the field value username.setValueAttribute(newValue); //submit the form form.submit(); //get object from session LoginBean bean=session.getAttribute("LoginBean"); assertEquals(newValue,bean.getUsername()); Brad Clarke <yo...@br...> Sent by: htm...@li... 03/02/2005 06:25 PM Please respond to htm...@li... To htm...@li... cc Subject Re: [Htmlunit-user] htmlunit and sessions I'm not sure exactly what you mean by "access to the session". Could you give an example? --- Rares Portan/SPR/RO <rp...@sa...> wrote: > Hello, > > I'm using HtmlUnit for a couple of days to create tests for a web app. > To test some of the pages I need to compare the form values with the > values of some objects kept in session. > > I wasn't able to get access to the session, is it possible? How can I do > that? > > Thank you ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Htmlunit-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlunit-user |