RichardDeray
IS-IT--Management
Hi,
I use HTTPUNIT for filling fields in a form and validate it. Until today, I used the 5 following code lines and that worked fine :
WebResponse wresponse = wc.getResponse("WebForm wform = wresponse.getForms()[0];
wform.setParameter("code","1234");
wresponse = wform.submit();
wresponse = wc.getCurrentPage();
But now I need to add a method to stop HTTPUNIT to control the datas set in the "setParameter" méthod.
For this reason, I used the newUnvalidatedRequest(); method.
Then I replaced the 2 above code lines :
wform.setParameter("code","1234");
wresponse = wform.submit();
with
WebRequest req = wform.newUnvalidatedRequest();
req.setParameter("code","1234");
wresponse = submitRequest(req);
In this situation, the submitRequest method is declared undefined.
Is someone can explain me why?
Thank you very much
RICHARD
I use HTTPUNIT for filling fields in a form and validate it. Until today, I used the 5 following code lines and that worked fine :
WebResponse wresponse = wc.getResponse("WebForm wform = wresponse.getForms()[0];
wform.setParameter("code","1234");
wresponse = wform.submit();
wresponse = wc.getCurrentPage();
But now I need to add a method to stop HTTPUNIT to control the datas set in the "setParameter" méthod.
For this reason, I used the newUnvalidatedRequest(); method.
Then I replaced the 2 above code lines :
wform.setParameter("code","1234");
wresponse = wform.submit();
with
WebRequest req = wform.newUnvalidatedRequest();
req.setParameter("code","1234");
wresponse = submitRequest(req);
In this situation, the submitRequest method is declared undefined.
Is someone can explain me why?
Thank you very much
RICHARD