Hi Julien,

That's exactly was what I was trying to do and it works. Interestingly,
I first tried gotoPage(url.toString()) but that gives me a

java.lang.NullPointerException
        at
net.sourceforge.jwebunit.htmlunit.HtmlUnitTestingEngineImpl.gotoPage(HtmlUnitTestingEngineImpl.java:198)
        at 
net.sourceforge.jwebunit.junit.WebTester.gotoPage(WebTester.java:2497)

....

beginAt(url.toString()) works perfectly.

Any ideas why?

Thanks for the quick response.

Jim


Julien HENRY wrote:
> Hi,
> 
> It is not an official feature but I'm quite sure it works with HtmlUnit
> testing engine. I use this construction very often to reproduce small bugs:
> 
> URL url = this.getClass().getResource("/file.html");
> beginAt(url.toString());
> 
> You simply need to put file.html in the classpath (in the resources
> folder if you are using Maven)
> 
> Regards,
> 
> Julien
> 
> ----- Message d'origine ----
> De : James Tse <[EMAIL PROTECTED]>
> À : jwebunit-users@lists.sourceforge.net
> Envoyé le : Lundi, 12 Mai 2008, 18h48mn 02s
> Objet : [JWebUnit-users] Testing local HTML files
> 
> Hi,
> 
> I have been trying to figure out a way to test local HTML files but I
> can't seem to figure it out from the API documentation. I tried setting
> up URLs in the format file://path/to/file and all I get is a
> NullPointerException. Is there a proper way to do this or is this
> unsupported in jwebunit?
> 
> I am using jwebunit-1.5.
> 
> Thanks,
> 
> Jim
> 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to