jueves, 27 de septiembre de 2007

Testing Web

HttpUnit es una alternativa para testear la navegación web, desde el lugar del usuario, basada en JUnit. Se interactúa como si fuera el browser, con URL y métodos para acceder a los campos e informaciones del html.
Eg:
    WebConversation wc = new WebConversation();
WebResponse resp = wc.getResponse( "http://www.meterware.com/testpage.html" );
Una vez que tenemos la WebResponse usamos los getters y setters para acceder a la info.
Eg:
WebTable table = resp.getTables()[0];
WebForm form = resp.getForms()[0]; // select the first form in the page

No hay comentarios: