public BrowserWrapper(IWebBrowser browser, IWebDriver driver, ITestInstance testInstance, ScopeOptions scope) { this.browser = browser; this.driver = driver; this.TestInstance = testInstance; ActionWaitTime = browser.Factory?.TestSuiteRunner?.Configuration.TestRunOptions.ActionTimeout ?? 250; ScopeOptions = scope; SetCssSelector(); }
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)); }
public BrowserWrapperFluentApi(IWebBrowser browser, IWebDriver driver, ITestInstance testInstance, ScopeOptions scope) : base(browser, driver, testInstance, scope) { }