// 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(); } }
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); } }
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); } }