I am using Selenium 2 WebDriver in C# to automate an input page. There is a validation summary control that is hidden when the DOM is loaded. Here's how it looks on additional load.
<div id='validation_summary' style='display: none'>
<div id='validation_message'/>
When my pageObject is initialized in Selenium, the Displayed property of the WebElement is set to 'false'. This I would expect.
After clicking a submit button, the dom is changed to:
<div id='validation_summary' style='display: block'>
<div id='validation_message'>
<div><a>Fix Me</a></div>
</div>
When I try to access the WebElement in the following manner, after the click to validate is issued, the Displayed property is still 'false' and the appended div is not visible:
var validation = new WebDriverWait(_driver, TimeSpan.FromSeconds(10)).Until<IWebElement>((d)=>d.FindElement(By.Id('validation_message'));
Should this actually work? Should I expect Selenium to be savvy enough to evaulate the DOM in its current state? How does it actually evaluate the Displayed property of an element? If I look at the PageSource property, I do see the text is present. I am not seeing why I don't see my changes reflected by Selenium.