Beispiel #1
0
 //This method Type the value which passed to this method
 public static bool SelectRadioButton(TestStack.White.UIItems.WindowItems.Window window, string elementid)
 {
     try
     {
         Radio radio = window.Get <Radio>(SearchCriteria.ByAutomationId(elementid));
         radio.Click();
         return(true);
     }
     catch (Exception)
     {
         try
         {
             Radio radio = window.Get <Radio>(SearchCriteria.ByText(elementid));
             radio.Click();
             return(true);
         }
         catch (Exception)
         {
             try
             {
                 Radio radio = window.Get <Radio>(SearchCriteria.ByClassName(elementid));
                 radio.Click();
                 return(true);
             }
             catch (Exception)
             {
                 Console.WriteLine("Not able to find the element");
                 return(false);
             }
         }
     }
 }
Beispiel #2
0
        // Perry Hunter 06/10/2013
        /// <summary>Selects the requested FGen waveform shape button</summary>
        /// <summary>PREREQUISITE: Function Generator mode UI context, Channel tab selected</summary>
        /// <param name="type"></param>
        public static void SelectFGenSignalTypeButton(string type)
        {
            string _buttonID = GetRadioButtonID(type);

            // RadioButton _button = AWGUI.currentUIControlPanel.Get<RadioButton>(SearchCriteria.ByAutomationId(_buttonID));
            //Kavitha
            RadioButton _button = AWGUI.currentMainWindow.Get <RadioButton>(SearchCriteria.ByAutomationId(_buttonID));

            Assert.IsNotNull(_button);

            Assert.IsTrue(_button.Enabled);

            _button.Click();
        }
Beispiel #3
0
        // Perry Hunter 06/10/2013
        /// <summary>Selects the specified radiobutton in the AWG Main Window</summary>
        /// <param name="radioButtonName">The AutomationID of the radio button to select</param>
        public static void SelectMainRadioButton(string radioButtonName)
        {
            //Commenting out the reference to the AWG for use in writing debug statements when in the UI.  This does not make sense.
            //AWG _awg = AwgSetupSteps.GetAWG("1");
            //_awg.DiagComment("Selecting the " + radioButtonName + " RadioButton in " + _awg.ModelString + " window");

            //The currentApplication and currentMainWindow are already defined from the setup steps...
            //Find the requested radiobutton by it's AutomationID (in WPF, this is name property)
            RadioButton _radiobutton = AWGUI.currentMainWindow.Get <RadioButton>(SearchCriteria.ByAutomationId(radioButtonName));

            //Check the IsEnabled property
            Assert.IsTrue(_radiobutton.Enabled.Equals(true), radioButtonName + " was not enabled, could not select when requested");

            //Click it
            _radiobutton.Click();

            //Check it's "IsSelected" property - should now be true
            Assert.IsTrue(_radiobutton.IsSelected.Equals(true), radioButtonName + " was not selected after clicking");
        }