take driver.manage().timeouts().implicitlyWait(timeOut, TimeUnit.SECONDS); and move it to finally statement