public void text ( int row , int col , String expectedText , double seconds ) { double end = System . currentTimeMillis ( ) + ( seconds * 1000 ) ; try { elementPresent ( seconds ) ; while ( ! element . get ( ) . tableCell ( row , col ) . get ( ) . text ( ) . equals ( expectedText ) && System . currentTimeMillis ( ) < end ) ; double timeTook = Math . min ( ( seconds * 1000 ) - ( end - System . currentTimeMillis ( ) ) , seconds * 1000 ) / 1000 ; checkText ( row , col , expectedText , seconds , timeTook ) ; } catch ( TimeoutException e ) { checkText ( row , col , expectedText , seconds , seconds ) ; } }
Waits for the element s text in a particular cell equals the provided expected text . If the element isn t present or a table this will constitute a failure same as a mismatch . The provided wait time will be used and if the element doesn t have the desired match count at that time it will fail and log the issue with a screenshot for traceability and added debugging support .