I have an application where everything starts from a single servlet and then based on some params to initial servlet complete behaviour of application changes, there are lots of things and forwarding which happens until you get response as a HTML.
I want to write test cases, where I only change those few initial parameters and get a response either as getText()
or getXml()
or getHTML()
.
I used HttpUnit, something like.
WebRequest request = new PostMethodWebRequest("http://localhost:9090/xyz/ETransServlet.fsc" );
request.setParameter( "window_id", "1" );
request.setParameter( "screen_id", "4" );
request.setParameter( "nav_to", "something.jsp" );
request.setParameter( "nav_from", "somethingfrom.jsp" );
HttpSession session = sr.getSession(true);
WebResponse response = client.getResponse(request);`
Now you see I have some parameter set window_id
and all.
first thing, they are not reaching somehow.
secondly, even if I call some page with no params, still it gives error something like can't process script <script> blab bla </script>
It's unable to process javascript code that we are using. I have js.jar and nekohtml.jar in build path and beside I don't want it to validate javascript or html at all.
Can anyone tell what's wrong or how to stop javascript to validate or fix it even if it validates or not or some other solution entirely.