Пример #1
0
        // Selects Check-box
        public static void SelectCheckbox(By locator)
        {
            WaitHelper.ElementExists(locator);

            if (!webDriver.FindElement(locator).GetAttribute("aria-checked").Equals("true"))
            {
                element = WaitHelper.ElementExists(locator);
                Actions actions = new Actions(webDriver);
                actions.MoveToElement(element).Click().Perform();
            }
        }
Пример #2
0
 internal static void UncheckCheckbox(By locator)
 {
     WaitHelper.ElementExists(locator);
     if (Instance.FindElement(locator).GetAttribute("aria-checked").Equals("true"))
     {
         Instance.FindElement(locator).Click();
         ReportHelper.PassLog("Successfully checkbox is unchecked: <br>" + locator);
     }
     else
     {
         ReportHelper.WarningLog("Checkbox is not checked for uncheck: <br>" + locator);
     }
 }
Пример #3
0
 internal static void IsHidden(By locator)
 {
     try
     {
         element = WaitHelper.ElementExists(locator);
         if (Browser.Instance.FindElement(locator).GetAttribute("aria-hidden").Equals("true"))
         {
             ReportHelper.PassLog("Expected element is hidden: <br>" + locator);
         }
         else
         {
             ReportHelper.WarningLog("Expected element is not hidden.");
         }
     }
     catch (AssertionException e)
     {
         ReportHelper.WarningLog("Expected element is not hidden: <br>" + locator.ToString() + "<br>" + e.Message);
     }
 }