コード例 #1
0
        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);
        }
コード例 #2
0
        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("&nbsp;{0}", config.MemorableInformation[zeroIndexedCharacterNumber]);
                memInfoInput.SelectByValue(value);
            }
        }
コード例 #3
0
ファイル: ElementHelper.cs プロジェクト: minskowl/MY
 public static void SelectOption(this IElementContainer b, string name, string value)
 {
     b.SelectList(Find.ByName(name)).Option(value).SelectNoWait();
 }
コード例 #4
0
 /// <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);
 }