예제 #1
0
 public static string GetButtonText_alt(By locator)
 {
     element = GenericHelper.GetElement(locator);
     //we are checking the html tag which has the value saved 
     if (element.Text == null)
         return String.Empty;
     else
         return element.Text;
 }
예제 #2
0
 public static void ClickButton(By locator)
 {
     try
     {
         element = GenericHelper.GetElement(locator);
         element.Click();
     } catch(ElementNotVisibleException e)
     {
         System.Console.WriteLine("Couldn't find button at location: " + locator.ToString() + "\n\n" + e.ToString());
     }
 }
예제 #3
0
 public static string GetRadioButtonText(By locator)
 {
     element = GenericHelper.GetElement(locator);
     //we are checking the html tag which has the value saved
     if (element.Text == null)
     {
         return(String.Empty);
     }
     else
     {
         return(element.Text);
     }
 }
예제 #4
0
        public static bool IsRadioButtonchecked(By locator)
        {
            element = GenericHelper.GetElement(locator);
            //here you give the attritube from the elemets desc by inspecting which tell syouthe value
            string flag = element.GetAttribute("checked");

            if (flag == null)
            {
                return(false);
            }
            else
            {
                return(flag.Equals("true") || flag.Equals("checked"));
            }
        }
예제 #5
0
        public static void GetTextAndCompare(By locator, string data)
        {
            element = GenericHelper.GetElement(locator);

            Assert.AreEqual(data, element.Text, ignoreCase: true, "Match failed for  : " + locator);
        }
예제 #6
0
 public static void ClickLink(By Locator)
 {
     element = GenericHelper.GetElement(Locator);
     element.Click();
 }
예제 #7
0
 public static void ClickRadioButton(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
 }
예제 #8
0
 public static void CheckedCheckbox(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Click();
 }
예제 #9
0
 public static bool IsButonEnabled(By locator)
 {
     element = GenericHelper.GetElement(locator);
     return element.Enabled;
 }
예제 #10
0
 public static IList <string> GetAllItem(By locator)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     return(select.Options.Select((x) => x.Text).ToList());
 }
예제 #11
0
 //the above method is overloaded to select the opion by providing the value
 public static void SelectElement(By locator, string visible_text)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByValue(visible_text);
 }
예제 #12
0
 public static void SelectElement(By locator, int index)
 {
     select = new SelectElement(GenericHelper.GetElement(locator));
     select.SelectByIndex(index);
 }
예제 #13
0
 public static void ClearTextBody(By locator)
 {
     element = GenericHelper.GetElement(locator);
     element.Clear();
 }
예제 #14
0
 public static void TypeInTextbox(By locator, string text)
 {
     element = GenericHelper.GetElement(locator);
     element.SendKeys(text);
 }