public void notEnabled ( double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { double timeTook = elementPresent ( seconds ) ; WebDriverWait wait = new WebDriverWait ( element . getDriver ( ) , ( long ) ( seconds - timeTook ) , DEFAULT_POLLING_INTERVAL ) ; wait . until ( ExpectedConditions . not ( ExpectedConditions . elementToBeClickable ( element . defineByElement ( ) ) ) ) ; timeTook = Math . min ( ( seconds * 1000 ) - ( end - System . currentTimeMillis ( ) ) , seconds * 1000 ) / 1000 ; checkNotEnabled ( seconds , timeTook ) ; } catch ( TimeoutException e ) { checkNotEnabled ( seconds , seconds ) ; } }
Waits for the element to not be enabled . The provided wait time will be used and if the element isn t present after that time it will fail and log the issue with a screenshot for traceability and added debugging support .