From: Marc G. <mgu...@ya...> - 2005-01-19 09:51:38
|
The MockWebConnection can do exactly that. Have a look at htmlunit unit tests: they use it intensively. Marc. David Ko wrote: > Hi, > > I am new to htmlunit. I am wondering if there is a > work around for me to pass in the html (as String or > some other form) to WebClient.getPage( ... ) instead > of passing in a URL. > > At the time of testing I am geneating a html page and > want to test the form and javascript. What I can do is > save the content of the html to file and set the URL > to the saved file and pass it in to > webclient.getPage(URL). But I would like to avoid > expensive io :) > > Thanks in advance, > David |