I am trying to find an element in my page. That element will only come if there is any error in the application. I handled that pretty well, only issue is that it waits for 30 secs (Implicit wait) to move to next step. I don't want to wait for 30 secs instead I'll like my script to wait for 3 secs before moving to next step, so I decided to use explicit wait for the same. Here is my code
WebDriverWait wait = new WebDriverWait(driver, 3);
wait.until(ExpectedConditions.presenceOfElementLocated(By.id("errorelement")));
Problem is that the Selenium webdriver is still waiting for that element upto 30 secs before giving an error and moving to next step. I tried with visibilityOfElementLocated option as well but it's still not working.
Am I missing something here ?
Selenium version:- 2.46.0
Browser :- Mozilla, Chrome