@ Override public boolean check ( EmbeddedBrowser browser ) { String js = "try{ if(" + expression + "){return '1';}else{" + "return '0';}}catch(e){" + " return '0';}" ; try { Object object = browser . executeJavaScript ( js ) ; if ( object == null ) { return false ; } return object . toString ( ) . equals ( "1" ) ; } catch ( CrawljaxException e ) { // Exception is caught, check failed so return false; return false ; } }
Check invariant .