aspose file tools*
The moose likes Testing and the fly likes HtmlUnit problem: Change the Request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "HtmlUnit problem: Change the Request" Watch "HtmlUnit problem: Change the Request" New topic
Author

HtmlUnit problem: Change the Request

sam backet
Greenhorn

Joined: Sep 02, 2011
Posts: 22

Hello,

I have a problem. I'm using a webApplication, which I run via a Jetty-Server
Now I want to send Requests, to test the responses.



But, I don't undersatnd it to change the session. A class of my application calls an attribut from the request. How is it possible to change the atrribut in my request.




Sam
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

request.getSession().setAttribute("newValue", newValue);


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
sam backet
Greenhorn

Joined: Sep 02, 2011
Posts: 22

It doesn' work, because I'm using the WebRequest from HMTL-Unit. and there is no "request.getSession"?

And if I use the WebRequest from class "HttpServletRequest" I don't know how to initialize the client. and send the message.

Do you know, how I can solve it?

michael
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HtmlUnit problem: Change the Request