Compare two innertext

Ask general questions here.
Asma
Posts: 1
Joined: Wed Apr 01, 2020 5:53 am

Compare two innertext

Post by Asma » Wed Apr 01, 2020 6:07 am

Hello,
I am new to Ranorex and I am trying to to achieve below

1. How to read the strings of two fields
2. convert strings into date
3. Compare date and find latest one

Could you please help.

Thanks,

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Compare two innertext

Post by odklizec » Wed Apr 01, 2020 5:17 pm

Hi,

Please post a Ranorex snapshot (NOT screenshot) with both fields.

Generally speaking, you can get the content of fields via GetValue action, then you have to use user code to convert both string variables to date, using DateTime.Parse(String value) method and then compare them with DateTime.Compare(DateTime, DateTime) method. Hope this helps?
Pavel Kudrys
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