Пример #1
0
 private static void SelectDay(string tableXPath, string day)
 {
     for (int i = 1; i <= 6; i++)
     {
         for (int j = 1; j <= 7; j++)
         {
             if (GenericHelper.IsElementPresentQuick(By.XPath(tableXPath + "//table/tbody/tr[" + i + "]/td[" + j + "]/a")))
             {
                 var xpath = tableXPath + "//table/tbody/tr[" + i + "]/td[" + j + "]/a";
                 var aday  = ObjectRepository.Driver.FindElement(By.XPath(xpath)).Text;
                 if (day.Equals(aday, StringComparison.OrdinalIgnoreCase))
                 {
                     if (
                         !ObjectRepository.Driver.FindElement(By.XPath(xpath))
                         .GetAttribute("class")
                         .Contains("k-other-month"))
                     {
                         ObjectRepository.Driver.FindElement(By.XPath(xpath)).Click();
                         return;
                     }
                 }
             }
         }
     }
 }
Пример #2
0
 private static void SelectYear(string tableXPath, string year)
 {
     for (int i = 1; i <= 3; i++)
     {
         for (int j = 1; j <= 4; j++)
         {
             if (GenericHelper.IsElementPresentQuick(By.XPath(tableXPath + "//table/tbody/tr[" + i + "]/td[" + j + "]/a")))
             {
                 string aYear = ObjectRepository.Driver.FindElement(By.XPath(tableXPath + "//table/tbody/tr[" + i + "]/td[" + j + "]/a")).Text;
                 if (year.Equals(aYear, StringComparison.OrdinalIgnoreCase))
                 {
                     ObjectRepository.Driver.FindElement(By.XPath(tableXPath + "//table/tbody/tr[" + i + "]/td[" + j + "]/a")).Click();
                     return;
                 }
             }
         }
     }
 }