Hello,
I have a scenario where I need to validate time displayed in the application.
Let's say, I created an appointment for a patient(Ex. 11.10pm) so, to validate this time format I use the below format and I'm storing this format
local variable to validate whether the system time matches with the appointment time displayed in the application and now
what happens is if there is a patient created in the application with time (0.51) during midnight below validation gets failed.
patient.appointment= System.DateTime.Now.ToString("dd-MM-yyyy HH:mm:ss");
var app_Time = repo.EnrollAppointment.Appoiment.Time;
Boolean appoint_time_info = app_Time.InnerText.Equals(patient.appointment);
Validate.IsTrue(appoint_time_info, "Validating inner text of Appointment time" +patient.appointment.InnerText.ToString());
Attached screenshot below please find the attachment.
Unable to validate time format
Unable to validate time format
You do not have the required permissions to view the files attached to this post.
Re: Unable to validate time format
Hi,
Could you please post a Ranorex snapshot of the problematic time element? It seems as if the validated time is displayed without leading zero, i.e. 0:51 instead of 00:51? But your used time format expects 00:00:00 time format? So please check the time returned by your app and update the time format accordingly.
Could you please post a Ranorex snapshot of the problematic time element? It seems as if the validated time is displayed without leading zero, i.e. 0:51 instead of 00:51? But your used time format expects 00:00:00 time format? So please check the time returned by your app and update the time format accordingly.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration