private void CheckFrames(IWebDriver driver) { // Setup our retry options first. var options = new BrowserCommandOptions { RetryAttempts = 1, ExceptionTypes = { typeof(StaleElementReferenceException), typeof(NoSuchFrameException) }, ExceptionAction = null }; var command = new DelegateBrowserCommand <bool>(options, d => { var iframes = GetFrameElements(d); foreach (IWebElement frame in iframes) { var currentFrameId = frame.GetAttribute("id"); driver.WaitUntilAvailable(By.Id(currentFrameId)); d.SwitchTo().Frame(currentFrameId); InjectRecordingScript(); //CheckFrames(driver); //Child Frames } return(true); }); command.Execute(driver); }
public BrowserCommandResult <TResult> Execute <TResult>(DelegateBrowserCommand <TResult> @delegate) { Browser.Depth++; var command = @delegate.Execute(Browser.Driver); Browser.CalculateResults(command); Browser.Depth--; return(command); }