I am having a problem with Manager.ActiveBrowser.Frames.ById() returns null intermittently. The conditions are as follows:
var resultsFrameExpression = new HtmlFindExpression("tagname=iframe", "id=searchResultsFrame");
browser.WaitForElement(resultsFrameExpression, 60000, false); // Successfully returns
-!!-> resultFrame = browser.Manager.ActiveBrowser.Frames.ById("searchResultsFrame");
Most of the time, resultFrame comes back with a valid result. Sometimes it comes back as null. If there is even a 10 second delay before calling RefreshDomTree() and trying again, it still occurs with about the same frequency. (My assumption was that there may have been a timing issue between WaitForElement()'s successful return before being able to access the element that it successfully claims exists, but this is not the case either.
Any insight as to what I am doing wrong here would be appreciated.
Thanks for your help