public void ElementWaitForTimeoutTest5() { var element = new ElementWrapper(new MockIWebElement(), browser); element.WaitFor((elm) => { var valueValidator = new ValueValidator("asdasdasdasd"); var v = new OperationResultValidator(); var result = valueValidator.Validate(elm); v.Validate <UnexpectedElementException>(result); }, 2000, "test timeouted", checkInterval: 100); }
public IBrowserWrapper GetFrameScope(string selector) { var options = new ScopeOptions { FrameSelector = selector, Parent = this, CurrentWindowHandle = Driver.CurrentWindowHandle }; var iframe = First(selector); //AssertUI.CheckIfTagName(iframe, new[] { "iframe", "frame" }, $"The selected element '{iframe.FullSelector}' is not a iframe element."); var resultValidator = new OperationResultValidator(); var validator = new TagNameValidator(new[] { "iframe", "frame" }, $"The selected element '{iframe.FullSelector}' is not a iframe element."); var results = validator.Validate(iframe); resultValidator.Validate <UnexpectedElementStateException>(results); var frame = browser.Driver.SwitchTo().Frame(iframe.WebElement); TestInstance.TestClass.CurrentScope = options.ScopeId; // create a new browser wrapper return(TestInstance.TestClass.TestSuiteRunner.ServiceFactory.Resolve <IBrowserWrapper>(browser, frame, TestInstance, options)); }