Ask a Question

GreaterThanOrEqual to on Dates no longer working

SOLVED
jaward916
Occasional Contributor

GreaterThanOrEqual to on Dates no longer working

Hi there,

 

since upgrading to 14.61 this week my tests are failing on comparison of a date time.

 

I have a timestamp set as:

var timestamp = dotNET["System"]["DateTime"]["Now"]["UtcNow"]["OleValue"];

this is then compared to a value extracted from a grid:

aqObject.CheckProperty(Grid.DataSource.DataSource.Item(RowId).Row, "StartedOn", cmpGreaterOrEqual, timestamp);

last week this worked absolutely fine, however today I get:

jaward916_0-1601396698685.png

As you can see it is equal to, not less than, and I am using greater or equal as my qualifier!!

 

Help, please?!

3 REPLIES 3
Marsha_R
Community Hero

Best thing to do is contact Support directly with this sort of question.  Here's their link:

https://support.smartbear.com/message/?prod=TestComplete


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
sonya_m
SmartBear Alumni (Retired)

Thank you Marsha!

@jaward916 I found your support ticket (00452292) about this. Please post the final results to the Community when you get them, this will help many people going forward.


Sonya Mihaljova
Community and Education Specialist

jaward916
Occasional Contributor

Hello all,

 

so yes, some back and forth with support on this, some of it down to my specific application, some down to my own understanding. In short, DateTimes are very clever but quite complex.

 

The issue stems from the line:

dotNET["System"]["DateTime"]["Now"]["UtcNow"]["OleValue"];

Where this is a FULL timestamp, down the beyond the seconds level...

However, the one in my grid I am comparing against only goes to the seconds, and therefore I'm in a situation where:

Timestamp =  12:05:55:xxxx

Grid = 12:05:55 without the .xxxx

And therefore it likely assumes .0000 which is, therefore, LESS THAN xxxx and not greater or equal.

 

So when timestamp values appear to be "equal to" in a UI sense they are not, as underneath one has a deeper level of accuracy!

 

What's more frustrating for me is when they appear "equal" it's a reflection of great performance on my tested application, usually there is a good second or 2 between the dates, so my update of TC was irrelevant, my apps were just running better last week!

 

 

 

cancel
Showing results for 
Search instead for 
Did you mean: