public static IElementContainer FillSelectList(this IElementContainer container, Constraint findBy, string value) { var element = container.SelectList(findBy); if (element.Exists) { if (value != null && element.Option(o => String.Equals(o.Value, value, StringComparison.OrdinalIgnoreCase)).Exists) { element.SelectByValue(value); } } return(container); }
public static void FillLloydsGroupMemorableInformation(IElementContainer browser, LloydsGroupConfig config) { for (var inputNumber = 1; inputNumber <= 3; inputNumber++) { var id = string.Format("frmentermemorableinformation1:strEnterMemorableInformation_memInfo{0}", inputNumber); var memInfoInput = browser.SelectList(Find.ById(id)); var characterLabel = memInfoInput.PreviousSibling.Text; var characterNumber = int.Parse(Regex.Match(characterLabel, @"Character (?<charNum>\d*)").Groups["charNum"].Value); var zeroIndexedCharacterNumber = characterNumber - 1; var value = string.Format(" {0}", config.MemorableInformation[zeroIndexedCharacterNumber]); memInfoInput.SelectByValue(value); } }
public static void SelectOption(this IElementContainer b, string name, string value) { b.SelectList(Find.ByName(name)).Option(value).SelectNoWait(); }
/// <summary> /// Selects the option. /// </summary> /// <param name="element">The element.</param> /// <param name="name">The name.</param> /// <param name="value">The value.</param> public static void SelectOption(this IElementContainer element, string name, string value) { element.SelectList(Find.ByName(name)).SelectByValue(value); }