Hi,
i tried with the same way as :
waitFor(60) {
ObjName.click()
true
}
but it didn't worked
My exact issue is that waitFor works find in "Login" class which follows exact geb POM where i have created static at , static url , static content
and follows with method implementation and same class i have extends from Page(geb.Page),
package pages
import geb.Browser
import geb.Page
import modules.OperationUtil
class Login extends Page {
static at = {title == "Login"}
static content = {
usernameField {$('input#username')}
passwordField {$('input#password')}
logInButton {$('button#login-submit')}
}
def "login To App"(username, password) {
try {
OperationUtil operationUtil = new OperationUtil();
waitFor(60) {
operationUtil.enterVal(usernameField, username);
operationUtil.enterVal(passwordField, password);
}
operationUtil.clickAnElement(logInButton)
waitFor(Integer.parseInt(ju.getJsonValue("maxWait"))) { logoutButton.displayed
slide.displayed }
}
catch(Exception e){
new ExceptionHandler().customizedException("Cannot login into the application");
e.printStackTrace();
}
}
}
but in other class "OperationUtil" where i have only extends with Page (geb.Page) and does method implementation.
package modules
import geb.Page
class OperationUtil extends Page {
def clickAnElement(objName){
waitFor(60) {
objName.click()
return true
}
}
}
so waitFor at OperationUtil doesn't work.
2020-06-12 11:53:42 ERROR - Issue with login: Instance of page class modules.OperationUtil has not been initialized.
Please pass it to Browser.to(), Browser.via(), Browser.page() or Browser.at() before using it.
2020-06-12 11:53:42 ERROR - Issue with login: Instance of page class modules.OperationUtil has not been initialized.
Please pass it to Browser.to(), Browser.via(), Browser.page() or Browser.at() before using it.
geb.error.PageInstanceNotInitializedException: Instance of page class modules.OperationUtil has not been initialized.
Please pass it to Browser.to(), Browser.via(), Browser.page() or Browser.at() before using it