/// <summary>Select all options by the text displayed.</summary> /// <param name="text">The text of the option to be selected. If an exact match is not found, /// this method will perform a substring match.</param> /// <remarks>When given "Bar" this method would select an option like: /// <para> /// <option value="foo">Bar</option></para> /// </remarks> public void SelectByText(string text, FindOperator oOperator) { if (text == null) { throw new ArgumentNullException("text", "text must not be null"); } if (TestSettings.Instance.Browser != TestFramework.Browser.BrowserType.FireFox) { this.Click(); } if (oOperator == FindOperator.Equals) { foreach (HtmlOption option in this.Options.Where(option => option.InnerText == text)) { if (!option.Selected) { option.Click(); } if (this.Multiple != null && this.Multiple != "true") { return; } } } if (oOperator == FindOperator.Contains) { foreach (HtmlOption option in this.Options.Where(option => option.InnerText.Contains(text))) { if (!option.Selected) { option.Click(); } if (this.Multiple != null && this.Multiple != "true") { return; } } } if (oOperator == FindOperator.StartsWith) { foreach (HtmlOption option in this.Options.Where(option => option.InnerText.StartsWith(text))) { if (!option.Selected) { option.Click(); } if (this.Multiple != null && this.Multiple != "true") { return; } } } }
public override void VisitFindOperator(FindOperator node) { base.VisitFindOperator(node); if (node.InClause == null || _position >= node.InClause.End) { _binder._rowScope = _binder.GetFindColumnsTable(node); } }
/// <summary>The find all by id.</summary> /// <param name="id">The id.</param> /// <param name="findOperator">The find operator.</param> /// <typeparam name="T">The type of HtmlControl.</typeparam> /// <returns>The <see cref="IEnumerable{T}"/>.</returns> public IEnumerable <T> FindAllById <T>(string id, FindOperator findOperator) where T : HtmlControl, new() { return(this.Browser.FindAllById <T>(id, findOperator)); }
public T FindByInnerText <T>(string innerText, FindOperator findOperator = FindOperator.Equals) where T : HtmlControl, new() { return(this.Browser.FindByInnerText <T>(innerText, findOperator)); }
/// <summary>The find by id.</summary> /// <param name="id">The id.</param> /// <param name="findOperator">The find Operator.</param> /// <typeparam name="T">The type of HtmlControl.</typeparam> /// <returns>The <see cref="T"/>.</returns> public T FindById <T>(string id, FindOperator findOperator = FindOperator.Equals) where T : HtmlControl, new() { return(this.Browser.FindById <T>(id, findOperator, this)); }
/// <summary>The find all by inner text.</summary> /// <param name="innerText">The inner text.</param> /// <param name="findOperator">The find operator.</param> /// <typeparam name="T">The type of HtmlControl.</typeparam> /// <returns>The <see cref="IEnumerable{T}"/>.</returns> public IEnumerable <T> FindAllByInnerText <T>(string innerText, FindOperator findOperator = FindOperator.Equals) where T : HtmlControl, new() { return(this.Browser.FindAllByInnerText <T>(innerText, findOperator, this)); }
/// <summary>The switch window.</summary> /// <param name="windowName">The window name.</param> /// <param name="findOperator">The find operator.</param> public abstract void SwitchWindow(string windowName = "", FindOperator findOperator = FindOperator.Equals);
/// <summary>The find by inner text.</summary> /// <param name="innerText">The inner text.</param> /// <param name="findOperator">The find operator.</param> /// <param name="containingControl">The containing Control.</param> /// <typeparam name="T">The type of HtmlControl.</typeparam> /// <returns>The <see cref="T"/>.</returns> public abstract T FindByInnerText <T>( string innerText, FindOperator findOperator = FindOperator.Equals, HtmlControl containingControl = null) where T : HtmlControl, new();
/// <summary>The find all by id.</summary> /// <param name="id">The id.</param> /// <param name="findOperator">The find operator.</param> /// <param name="containingControl">The containing Control.</param> /// <typeparam name="T">The type of HtmlControl.</typeparam> /// <returns>The <see cref="IEnumerable{T}"/>.</returns> public abstract IEnumerable <T> FindAllById <T>( string id, FindOperator findOperator = FindOperator.Equals, HtmlControl containingControl = null) where T : HtmlControl, new();
public override T VisitFindOperator(FindOperator node) { throw new NotImplementedException(); }