コード例 #1
0
        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))));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
 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))));
 }