Setting the date to one day previous
Posted: Fri Apr 10, 2015 5:20 pm
I have a date field. I am trying to set the date to the previous date on any give date.
the C# code for this would be eqivalent to:
DateTime startDate = Datetime.Now;
Console.WriteLine(startDate.AddDays(-1).ToShortDateString);
Console.ReadLine();
so if the date today is 5/15/2014 then the date set should be 5/14/2014
This date has to be set to the element startDate with the xpath
(.//tabpage[@title~'^VERC-23451\ -\ Williams,\ Wa' and @controltypename='TabPage']/?/?/container[@controltypename='SplitContainer']/container[2]/?/?/tabpage[@title~'^Procedure:\ MCT\ 4/10/2015\ ' and @controltypename='TabPage']/container/container[@controltypename='Panel']/container[@controltypename='Panel']/container[@controltext='Procedure Information']/datetime[@controltypename='DateTimePicker']/?)
The Date TimePicker has to read the value of yesterday's day.
The errors that I get are
(1) The type or namespace name 'Datetime' does not exist in the namespace 'System' (are you missing an assembly reference?) (CS0234) - C:\Users\BeaconUser\Documents\Ranorex\RanorexStudio Projects\Patients\Patients\NewPatientFile.UserCode.cs:44,45
(2) Ranorex.Unknown' does not contain a definition for 'set' and no extension method 'set' accepting a first argument of type 'Ranorex.Unknown' could be found (are you missing a using directive or an assembly reference?) (CS1061) - C:\Users\BeaconUser\Documents\Ranorex\RanorexStudio Projects\Patients\Patients\NewPatientFile.UserCode.cs:45,47
Please Help
Thank you!!!
the C# code for this would be eqivalent to:
DateTime startDate = Datetime.Now;
Console.WriteLine(startDate.AddDays(-1).ToShortDateString);
Console.ReadLine();
so if the date today is 5/15/2014 then the date set should be 5/14/2014
This date has to be set to the element startDate with the xpath
(.//tabpage[@title~'^VERC-23451\ -\ Williams,\ Wa' and @controltypename='TabPage']/?/?/container[@controltypename='SplitContainer']/container[2]/?/?/tabpage[@title~'^Procedure:\ MCT\ 4/10/2015\ ' and @controltypename='TabPage']/container/container[@controltypename='Panel']/container[@controltypename='Panel']/container[@controltext='Procedure Information']/datetime[@controltypename='DateTimePicker']/?)
The Date TimePicker has to read the value of yesterday's day.
The errors that I get are
(1) The type or namespace name 'Datetime' does not exist in the namespace 'System' (are you missing an assembly reference?) (CS0234) - C:\Users\BeaconUser\Documents\Ranorex\RanorexStudio Projects\Patients\Patients\NewPatientFile.UserCode.cs:44,45
(2) Ranorex.Unknown' does not contain a definition for 'set' and no extension method 'set' accepting a first argument of type 'Ranorex.Unknown' could be found (are you missing a using directive or an assembly reference?) (CS1061) - C:\Users\BeaconUser\Documents\Ranorex\RanorexStudio Projects\Patients\Patients\NewPatientFile.UserCode.cs:45,47
Please Help
Thank you!!!