コード例 #1
0
ファイル: Actions.cs プロジェクト: k3foru/CUIT_Framework
 public static void SelectDropdownByIndex(int index)
 {
     var dropdownControl = new HtmlComboBox(browserWindow);
     try
     {
         dropdownControl.SearchProperties[CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType] = CSVReader.LocatorValue;
         dropdownControl.WaitForControlEnabled();
         dropdownControl.WaitForControlReady();
     }
     catch (Exception)
     {
         Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
     }
     dropdownControl.SelectedIndex = index;
 }
コード例 #2
0
        public static void SelectDropdownByIndex(int index)
        {
            var dropdownControl = new HtmlComboBox(browserWindow);

            try
            {
                dropdownControl.SearchProperties[CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType] = CSVReader.LocatorValue;
                dropdownControl.WaitForControlEnabled();
                dropdownControl.WaitForControlReady();
            }
            catch (Exception)
            {
                Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
            }
            dropdownControl.SelectedIndex = index;
        }
コード例 #3
0
ファイル: Actions.cs プロジェクト: k3foru/CUIT_Framework
 public static void SelectDropdownByText(string text)
 {
     var dropdownControl = new HtmlComboBox(browserWindow);
     try
     {
         dropdownControl.SearchProperties[CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType] = CSVReader.LocatorValue;
         dropdownControl.WaitForControlEnabled();
         dropdownControl.WaitForControlReady();
     }
     catch (Exception)
     {
         Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
     }
     if (!dropdownControl.SelectedItem.Equals(text))
     {
         foreach (var t in dropdownControl.Items.Where(t => t.Name == text))
         {
             dropdownControl.SelectedItem = text;
             break;
         }
     }
 }
コード例 #4
0
        public static void SelectDropdownByText(string text)
        {
            var dropdownControl = new HtmlComboBox(browserWindow);

            try
            {
                dropdownControl.SearchProperties[CSVReader.ControlType + ".PropertyNames." + CSVReader.LocatorType] = CSVReader.LocatorValue;
                dropdownControl.WaitForControlEnabled();
                dropdownControl.WaitForControlReady();
            }
            catch (Exception)
            {
                Assert.Fail("Failed to find " + CSVReader.ControlType + " Element - Element not Found");
            }
            if (!dropdownControl.SelectedItem.Equals(text))
            {
                foreach (var t in dropdownControl.Items.Where(t => t.Name == text))
                {
                    dropdownControl.SelectedItem = text;
                    break;
                }
            }
        }