public void alertEquals ( double seconds , String expectedAlertText ) { try { double timeTook = popup ( seconds ) ; timeTook = popupEquals ( seconds - timeTook , expectedAlertText ) ; checkAlertEquals ( expectedAlertText , seconds , timeTook ) ; } catch ( TimeoutException e ) { checkAlertEquals ( expectedAlertText , seconds , seconds ) ; } }
Waits up to the provided wait time for an alert present on the page has content equal to the expected text . This information will be logged and recorded with a screenshot for traceability and added debugging support .