I tried to modify "pagination test" project and see the image as the result:

Is it any rule where I have to place the delay command " Thread.sleep(5000);" to have the delay result. I copied the place where it was at "selenium saturday" project.
Thanks
It has to do with possible exception thrown, thus either add "throws InterruptedException" after method header or surround sleep with try/catch .. Just click on first suggestion for now
Oleg is correct.
We used Thread.sleep(5000) to slow down the test method execution so that the element that it tries finding is in the page.
This was for the login error message.
Without the delay, the test method tries finding the error message which is not yet in the page so the test method fails.
Thread.sleep() is not needed as soon as you replace
driver.findElement() with wait.until(ExpectedConditions.visibilityOfElementLocated())
driver.getTitle() with wait.until(ExpectedConditions.titleContains())
driver.getCurrentUrl() with wait.until(ExpectedConditions.urlContains())
Thanks guys.
you are welcome.
keep asking, Viktor.