I am having an issue in Selenium which has been recurring through my test suite that reports elements not present after they clearly are, and Selenium even reports that they are via isElementPresent()
.
For example, I have a page loading with a text field. After selenium.waitForPageToLoad()
is complete, selenium intermittently reported the text field missing. To find out if this was
a timing issue, I added a Thread.sleep(5000)
after the page loads, and to verify the
element is present:
logger.debug("Element present status: " + selenium.isElementPresent(elements.get("File Path Text Field")));
The strange thing is, every time I run the script, the page loads with no problems. During the 5 second sleep I can clearly see the text field. EVERY TIME the logger statement above reports "true" for the element being present. The very next line of code is
selenium.type("something");
and it's a craps shoot whether or not it reports the element being present or not. Has anybody else had problems like this and know how to resolve them?
Thanks in advanced.