title: can't use withFrame in page class content
body: <p>I am using geb-spock. I am trying to validate content of the page class, in the page itsself so that I just call the variable or functions. Using functions. I did something like this</p>
  
  <pre><code>class BasePage extends Page {
      static content = { 
  
         verifyheader { withFrame ("myFrame") { assert $("h1").text() == "Header1" } 
  
      }
    }
  }
  
  
  
    ...
  
  then: 
    to BasePage  
  and: 
    verifyheader 
  </code></pre>
  
  <blockquote>
    <blockquote>
      <p>I am getting an error that the test failed and withFrame is null.
      This does not occuer when I put the withFrame in the test case</p>
    </blockquote>
  </blockquote>
  
  <pre><code>  then: 
      to BasePage
    and: 
     withFrame('myFrame') {...}
  </code></pre>
  
  <p>This worked perfectly, but I am looking to use it in the page class. Is it possible? How can I go about it? or in other words, what is wrong with my code</p>