internal WaitThenClick(Driver driver, Options options, Waiter waiter, ElementFinder elementFinder) : base(driver, options) { this.options = options; this.waiter = waiter; this.elementFinder = elementFinder; }
public ElementFound ResolveQuery(ElementFinder elementFinder) { var all = elementFinder.Find(elementFinder.Options).ToArray(); if (!all.Any()) throw elementFinder.GetMissingException(); return all.First(); }
private static ElementFound[] PreferExect(ElementFinder elementFinder) { var results = Find(elementFinder, Options.Exact); if (results.Any() || !elementFinder.SupportsSubstringTextMatching) return results; return Find(elementFinder, Options.Substring); }
private static void Finds_elements_among_multiple_scopes(ElementFinder elementFinder1, ElementFinder elementFinder2) { var iframeOne = new BrowserWindow(DefaultSessionConfiguration, elementFinder1, Driver, null, null, null, DisambiguationStrategy); var iframeTwo = new BrowserWindow(DefaultSessionConfiguration, elementFinder2, Driver, null, null, null, DisambiguationStrategy); Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId"); Button("scoped button", iframeTwo, DefaultOptions).Id.should_be("iframe2ButtonId"); }
internal WaitThenClick(Driver driver, Options options, Waiter waiter, ElementFinder elementFinder, DisambiguationStrategy disambiguationStrategy) : base(driver, options) { waitBeforeClick = options.WaitBeforeClick; this.waiter = waiter; this.elementFinder = elementFinder; this.disambiguationStrategy = disambiguationStrategy; }
private static void Finds_elements_among_multiple_scopes(ElementFinder elementFinder1, ElementFinder elementFinder2) { var iframeOne = new DriverScope(new SessionConfiguration(), elementFinder1, Driver, null, null, null); var iframeTwo = new DriverScope(new SessionConfiguration(), elementFinder2, Driver, null, null, null); Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId"); Driver.FindButton("scoped button", iframeTwo).Id.should_be("iframe2ButtonId"); }
public ElementFound ResolveQuery(ElementFinder elementFinder) { ElementFound[] results; if (elementFinder.Options.TextPrecision == TextPrecision.PreferExact) results = PreferExect(elementFinder); else results = Find(elementFinder); if (elementFinder.Options.Match == Match.Single && results.Length > 1) throw new AmbiguousException(elementFinder.Options.BuildAmbiguousMessage(elementFinder.QueryDescription, results.Length)); if (!results.Any()) throw elementFinder.GetMissingException(); return results.First(); }
internal ElementScope(ElementFinder elementFinder, DriverScope outerScope) : base(elementFinder, outerScope) { }
private static ElementFound[] Find(ElementFinder elementFinder, Options preferredOptions = null) { return elementFinder.Find((Options.Merge(preferredOptions, elementFinder.Options))).ToArray(); }
protected static Element FindSingle(ElementFinder finder) { return(DisambiguationStrategy.ResolveQuery(finder)); }
public ElementFound ResolveQuery(ElementFinder elementFinder) { return elementFinder.Find(elementFinder.Options).FirstOrDefault(); }
internal DeferredElementScope(ElementFinder elementFinder, DriverScope outer) : base(elementFinder, outer) { }
internal BrowserWindow(SessionConfiguration SessionConfiguration, ElementFinder elementFinder, Driver driver, RobustWrapper robustWrapper, Waiter waiter, UrlBuilder urlBuilder) : base(SessionConfiguration, elementFinder, driver, robustWrapper, waiter, urlBuilder) { }
private static Element[] Find(ElementFinder elementFinder, Options preferredOptions = null) { return(elementFinder.Find((Options.Merge(preferredOptions, elementFinder.Options))).ToArray()); }
internal BrowserWindow(ElementFinder elementFinder, DriverScope outerScope) : base(elementFinder, outerScope) { }
internal BrowserWindow(SessionConfiguration SessionConfiguration, ElementFinder elementFinder, Driver driver, TimingStrategy timingStrategy, Waiter waiter, UrlBuilder urlBuilder, DisambiguationStrategy disambiguationStrategy) : base(SessionConfiguration, elementFinder, driver, timingStrategy, waiter, urlBuilder, disambiguationStrategy) { }
protected static ElementFound FindSingle(ElementFinder finder) { return DisambiguationStrategy.ResolveQuery(finder); }
internal RobustElementScope(ElementFinder elementFinder, DriverScope outerScope, Options options) : base(elementFinder, outerScope) { this.options = options; }
internal SynchronisedElementScope(ElementFinder elementFinder, DriverScope outerScope, Options options) : base(elementFinder, outerScope) { this.options = options; }