예제 #1
0
 private void ValidateElement(IWebElement element, string fieldSelector, MatchConditions conditions)
 {
     if (conditions.HasFlag(MatchConditions.Visible))
     {
         if (!element.Displayed)
         {
             throw new MatchConditionException(fieldSelector, MatchConditions.Visible);
         }
     }
     else if (conditions.HasFlag(MatchConditions.Hidden))
     {
         if (element.Displayed)
         {
             throw new MatchConditionException(fieldSelector, MatchConditions.Hidden);
         }
     }
 }
 private void ValidateElement(Automation.Core.Element element, string fieldSelector, MatchConditions conditions)
 {
     if (conditions.HasFlag(MatchConditions.Visible))
     {
         if (element.Style.Display.ToLower().Contains("none") || element.Style.GetAttributeValue("visibility") == "hidden")
         {
             throw new MatchConditionException(fieldSelector, MatchConditions.Visible);
         }
     }
     else if (conditions.HasFlag(MatchConditions.Hidden))
     {
         if (!element.Style.Display.ToLower().Contains("none") && !(element.Style.GetAttributeValue("visibility") == "visible"))
         {
             throw new MatchConditionException(fieldSelector, MatchConditions.Hidden);
         }
     }
 }
예제 #3
0
 private void ValidateElement(Automation.Core.Element element, string fieldSelector, MatchConditions conditions)
 {
     if (conditions.HasFlag(MatchConditions.Visible))
     {
         if (element.Style.Display.ToLower().Contains("none") || element.Style.GetAttributeValue("visibility") == "hidden")
         {
             throw new MatchConditionException(fieldSelector, MatchConditions.Visible);
         }
     }
     else if (conditions.HasFlag(MatchConditions.Hidden))
     {
         if (!element.Style.Display.ToLower().Contains("none") && !(element.Style.GetAttributeValue("visibility") == "visible"))
         {
             throw new MatchConditionException(fieldSelector, MatchConditions.Hidden);
         }
     }
 }