Beispiel #1
0
 private void TMonth_TextChanged(object sender, EventArgs e)
 {
     if (TMonth.Text.Any(x => !char.IsDigit(x)))
     {
         TMonth.Text = string.Concat(TMonth.Text.Where(char.IsDigit));
         TMonth.Select(TMonth.Text.Length, 0);
     }
 }
Beispiel #2
0
        public void SelectDateTime(string Month, string Year, string Date, string Time)
        {
            DateTime.Click();
            TMonth.Click();
            _seleniumExtGeneral.FindElementBy(By.XPath("//*[text()='"
                                                       + Month + "']")).Click();
            TYear.Click();
            _seleniumExtGeneral.FindElementBy(By.XPath("//*[ text()='"
                                                       + Year + "']")).Click();
            _seleniumExtGeneral.FindElementBy(By.XPath("//*[not(contains(@class,'react-datepicker__day--outside-month')) and text()='"
                                                       + Date + "']")).Click();
            IWebElement time = _seleniumExtGeneral.FindElementBy(By.XPath("//*[@class='react-datepicker__time-list-item ' and text()='"
                                                                          + Time + "']"));

            ((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].scrollIntoView(true);", time);
            time.Click();
            ((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].scrollIntoView(true);", DateTime);
        }