I think your problem may be related to this known issue:
I made a change to try to fix it, but I'm not sure if the change works. You can try it yourself if you want to try the latest snapshot:
<repository> <id>snapshots.jboss.org</id> <url>http://snapshots.jboss.org/maven2</url> <releases> <enabled>false</enabled> </releases> <snapshots> </snapshots> </repository> <dependency> <groupId>org.jboss.jsfunit</groupId> <artifactId>jboss-jsfunit-core</artifactId> <version>1.0.0.GA-SNAPSHOT</version> <scope>compile</scope> </dependency>
Also, are you aware of this feature to aid with login?
And this one to help debugging HtmlUnit behavor? The snapshot version will allow you to enable the snooper.
Lastly, it is a bit odd that you would start your test with
JSFSession jsfSession = new JSFSession("/myPage.jsp");
The only way that would work is if you are using a path-mapping for the FacesServlet and you map your web app to the root context. Most people use extension mapping and start their tests like this:
JSFSession jsfSession = new JSFSession("/myPage.faces");
Actually I wasn't aware about you just showed... I started to work with JSFUnit a few days ago and maybe I didn't search enough yet.... I'll check out the links you said.
I agree with you about the "/myPage.faces" instead of "/myPage.jsp"... I didn't design this system I'm working now, but this is definitely something to refactor asap.
I'll post the results here later.
Thanks a lot for your help.