Compare two innertext

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

Compare two innertext

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

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.


User avatar
Ranorex Guru
Ranorex Guru
Posts: 6520
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


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