public void task(string taskStartDate, string taskEndDate) { DateTimePicker stDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteTaskCompletedFromDate")); stDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(taskStartDate); DateTimePicker edDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteTaskCompletedToDate")); stDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(taskEndDate); }
public void DateFliter( DateType dateType, FromType fromType, // For date (fromType=0) or for Period (fromType=1) string startDate, string endDate, PeriodBack fromBack, PeriodAhead toAhead ) { ComboBox Drp = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboDateType")); Drp.Items[(int)dateType].Select(); Console.WriteLine(Drp.SelectedItemText.ToString()); switch (fromType) { case FromType.Date: advanceSearch.Get <RadioButton>(SearchCriteria.ByAutomationId("rdbDate")).Click(); DateTimePicker stDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteStartDate")); stDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(startDate); DateTimePicker edDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteEndDate")); edDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(endDate); break; case FromType.Period: ComboBox Drp2 = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboFromPeriod")); Drp2.Items[(int)fromBack].Select(); ComboBox Drp3 = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboToPeriod")); Drp3.Items[(int)toAhead].Select(); break; } }
public void trackingDateSecl(selType sel, string taskDateFrom, string taskDateTo) { if ((taskDateFrom.Length > 0 && taskDateTo.Length <= 0) || (taskDateTo.Length > 0 && taskDateFrom.Length <= 0)) { throw new System.ArgumentException("Missing Start or End Date"); } selType c = sel; string str = ""; switch (c) { case selType.Task: str = "TaskCompleted"; break; case selType.Content: str = "ContentReq"; break; case selType.Contact: str = "Contact"; break; case selType.Notes: str = "NoteCreated"; break; } if (taskDateFrom.Length > 2) { DateTimePicker fromDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dte" + str + "FromDate")); fromDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(taskDateFrom); } if (taskDateTo.Length > 2) { DateTimePicker toDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dte" + str + "ToDate")); toDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(taskDateTo); } }
public void DateUsage(FromType fromType, string usageStartDate, string usageEndDate, PeriodBack fromBack, PeriodAhead toAhead) { switch (fromType) { case FromType.Date: DateTimePicker stDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteUsageDateFrom")); stDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(usageStartDate); DateTimePicker edDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteUsageDateTo")); stDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(usageEndDate); break; case FromType.Period: ComboBox Drp2 = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboUsagePeriodFrom")); Drp2.Items[(int)fromBack].Select(); ComboBox Drp3 = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboUsagePeriodTo")); Drp3.Items[(int)toAhead].Select(); break; } }
public void DateFliter( string dateType, // For Date Type Drop down int fromType, // For date (fromType=0) or for Period (fromType=1) string startDate, string endDate, string fromKeyword, // For From Drop down string toKeyword // to From Drop down ) { ComboBox Drp = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboDateType")); Drp.Select(dateType); Console.WriteLine(Drp.SelectedItemText.ToString()); if (fromType == 0) { advanceSearch.Get <RadioButton>(SearchCriteria.ByAutomationId("rdbDate")).Click(); DateTimePicker stDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteStartDate")); stDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(startDate); #region WaitSyntax //DateTime beginWait = DateTime.Now; //while (!Console.KeyAvailable && DateTime.Now.Subtract(beginWait).TotalSeconds < 5) // Thread.Sleep(250); #endregion DateTimePicker edDate = advanceSearch.Get <DateTimePicker>(SearchCriteria.ByAutomationId("dteEndDate")); edDate.Get(SearchCriteria.ByAutomationId("txtDateTime")).SetValue(endDate); } else { ComboBox Drp2 = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboFromPeriod")); Drp2.Select(fromKeyword); ComboBox Drp3 = advanceSearch.Get <ComboBox>(SearchCriteria.ByAutomationId("cboToPeriod")); Drp3.Select(toKeyword); } }