title: How to use the Page Object Pattern in Play 2.1 test classes?
body: <p>I am a new user of Play and working through the ToDo List example (the beginner Java-based tutorial).</p>
  
  <p>I am now experimenting with adding test cases using the Page Object Pattern (<a href="https://github.com/FluentLenium/FluentLenium#page-object-pattern" rel="nofollow">https://github.com/FluentLenium/FluentLenium#page-object-pattern</a>).</p>
  
  <p>Unfortunately, my initial attempts to implement this pattern have not gone well.   My entire system is available at GitHub if you would like to quickly download and play with it.  Here is a link to my test class, which shows both a running test case (that does not use the Page Object Pattern) and a failing test case that attempts to use the Page Object Pattern:</p>
  
  <p><a href="https://github.com/philipmjohnson/playexample1/blob/master/test/IntegrationTest.java" rel="nofollow">https://github.com/philipmjohnson/playexample1/blob/master/test/IntegrationTest.java</a></p>
  
  <p>Here is the error when I run the test cases inside the Play console):</p>
  
  <pre><code>[error] Test IntegrationTest.testWithPage failed: java.lang.NullPointerException
  [error]     at play.test.Helpers.running(Helpers.java:426)
  [error]     at IntegrationTest.testWithPage(IntegrationTest.java:34)
  [error]     ...
  [error] Caused by: java.lang.NullPointerException
  [error]     at org.fluentlenium.core.Fluent.goTo(Fluent.java:223)
  [error]     at org.fluentlenium.core.FluentPage.go(FluentPage.java:55)
  [error]     at org.fluentlenium.core.Fluent.goTo(Fluent.java:204)
  [error]     at IntegrationTest$2.invoke(IntegrationTest.java:37)
  [error]     at IntegrationTest$2.invoke(IntegrationTest.java:34)
  [error]     at play.test.Helpers.running(Helpers.java:424)
  </code></pre>
  
  <p>How do I correctly implement the Page Object design pattern?</p>