public void waitForChecked ( final long time ) throws WidgetException { super . waitForCommand ( new ITimerCallback ( ) { @ Override public boolean execute ( ) { WebElement elem = null ; try { elem = getWebElement ( ) ; } catch ( WidgetException e ) { } boolean isSelected = false ; try { isSelected = isSelected ( elem ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } return ( elem != null && isSelected ) ; } @ Override public String toString ( ) { return "Waiting for element with the locator: " + getByLocator ( ) + "to be checked" ; } } , time ) ; }
Waits for element at locator to be checked within period of specified time