When using GEB for automated testing, jumping to a new page often uses the at syntax, for example in a Schooladdpage.groovy:
Class Schooladdpage extends page{
static at = {
$ ('. Box-title '). Text () = = "Add English World"
}
}
The following error message often appears when you run the program, as detailed below. Do not doubt if you choose the wrong object or error, it may be that the program runs too fast. Can be modified into:
static at = {
WaitFor () {$ ('. Box-title '). Text () = = "Add English World"}
}
Maybe we can solve the problem.
Geb.error.UnexpectedPageException:At Checker page verification failed for page page. Schooladdpage
At Geb.navigator.NonEmptyNavigator.click (nonemptynavigator.groovy:492)
At Geb.navigator.NonEmptyNavigator.click (nonemptynavigator.groovy:469)
At Geb.content.TemplateDerivedPageContent.click (templatederivedpagecontent.groovy:71)
Schoolmanagespec.to Add a school page (schoolmanagespec.groovy:59)
Caused By:assertion failed:
$ ('. Box-title '). Text () = = "Add English World"
| | |
[] Null False
At page. Schooladdpage._clinit__closure2 (Schooladdpage.groovy:8)
At Cn.com.nd.school.page.schooladdpage._clinit__closure2 (Schooladdpage.groovy)
At Geb. Page.verifythispageatonly (page.groovy:228)
At Geb. Page.verifyat (page.groovy:182)
At Geb. Browser.methodmissing (browser.groovy:206)
At Geb.navigator.NonEmptyNavigator.click (nonemptynavigator.groovy:481)
... 3 more
GEB Common error Analysis (i): at grammar check