The FindElement() method doesn't seem to work with an XPath locator, if called on an existing WebElement.
My code is this:
htmlDiv = _driver.FindElement(By.XPath("//h2[text()='" + onvNaam + "']/../..")); htmlControl = htmlDiv.FindElement(By.XPath("//label[text()='Naam']/following-sibling::div//select"));
The result of this code is that htmlControl contains the first matching element in the page, not the matching element in htmlDiv.
For other controls (with other By types) this seems to work.
Is the Xpath double slash superceding the scope of htmlDiv?