public FrameCollection FindFrames(string locator, Scope scope, Options options) { var exact = options.TextPrecision == TextPrecision.Exact; var byTitle = exact ? Find.ByTitle(locator) : Find.ByTitle(t => t.Contains(locator)); var byText = exact ? Find.ByText(locator) : Find.ByText(t => t.Contains(locator)); return(WatiNDocumentScope(scope).Frames .Filter((byTitle | Find.ByName(locator) | Find.ById(locator) | Constraints.HasElement("h1", byText)))); }
public WatiN.Core.Element FindFieldset(string locator, Scope scope) { var withId = Find.ById(locator); var withLegend = Constraints.HasElement("legend", Find.ByText(locator)); var hasLocator = withId | withLegend; var isVisible = Constraints.IsVisible(scope.ConsiderInvisibleElements); return(WatiNScope(scope).Fieldsets().First(hasLocator & isVisible)); }
public WatiN.Core.Element FindSection(string locator, Scope scope) { var isSection = Constraints.OfType(typeof(Section), typeof(Div)); var hasLocator = Find.ById(locator) | Constraints.HasElement(new[] { "h1", "h2", "h3", "h4", "h5", "h6" }, Find.ByText(locator)); var isVisible = Constraints.IsVisible(scope.ConsiderInvisibleElements); return(WatiNScope(scope).Elements.First(isSection & hasLocator & isVisible)); }
public Frame FindFrame(string locator, Scope scope) { return(WatiNDocumentScope(scope).Frames.First(Find.ByTitle(locator) | Find.ByName(locator) | Find.ById(locator) | Constraints.HasElement("h1", Find.ByText(locator)))); }