Was just reading this question https://stackoverflow.com/questions/26882604/selenium-difference-between-webdriver-findelement-and-webelement-findelement trying to understand the scope of the webelements findelement()
.
I have a scenario were I am looking for a radio button on a form and sometimes it is throwing an exception that another element will receive the click. So, I'm creating an extension method to wait till the element is clickable.. By finding it, checking if its clickable, if not loop round and find it again.
What I am wanting to know is, will this method work as expected? Or because I am using the webelement.findelement()
method it will always pickup the the old none clickable radio button?
With findelement
searching within that elements scope, not too sure if it will always find old elements at the time i get the form or be aware of any elements that get added or removed from it?
Example Code:
var element = _driver.TryFindElementWait(MyElement);
var myChildElement = element.TryFindElementWait(ChildElement);
If the dom of the element changes whilst doing element.TryFindElementWait()
will element be aware of the changes or will it still be looking for an element that may or may not exist in element?