Report: Warning-sign/color missing if data source empty

Ranorex Spy, Recorder, and Studio.
BCTest
Posts: 88
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Report: Warning-sign/color missing if data source empty

Post by BCTest » Mon Aug 29, 2016 7:27 am

Hello,

perhaps this behavior is wanted but I would prefer to get a warning sign in the report when the data source is valid but is empty. I accidentally cleared a data table which contained data values and didn't noticed it because the warning in the report was only visible when showing the details of the recording.
warning1.png
Zero data warning
warning1.png (2.96 KiB) Viewed 695 times
I would have found this issue faster if it was marked as a warning.

Regards,
Thomas

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Report: Warning-sign/color missing if data source empty

Post by krstcs » Mon Aug 29, 2016 2:37 pm

This is by design. Ranorex assumes that if there are no rows returned, then the test case should not be run. This allows for dynamic testing, especially through database connectors where the queries can be changed at runtime.

I would object to having a warning placed there because I use this feature and actually have instances where my data connector returns no rows, on purpose, depending on what the parent test case needs. I do not want to see warnings for this because it would clutter up my results.



If you aren't using a code versioning system like Git or SVN, I would highly recommend it. This would be one tool that would help you notice and recover from a user-error like this (I've done the same thing, so I'm not pointing fingers at you! :D ).
Shortcuts usually aren't...

BCTest
Posts: 88
Joined: Tue Jun 03, 2014 10:15 am
Location: Hamburg, Germany

Re: Report: Warning-sign/color missing if data source empty

Post by BCTest » Mon Aug 29, 2016 3:30 pm

Hmm,
my suggestion doesn't seem to be a suitable solution for all test cases.
Our Data Sources always have at least one recordset but I understand: yours can be empty. Difficult to find a solution both usages will satisfy.

By the way: we use Subversion but this didn't prevented me to clear the datatable - even if it was unwanted.
I assume I have to take a closer look on the reports!

Regards,
Thomas.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Report: Warning-sign/color missing if data source empty

Post by krstcs » Mon Aug 29, 2016 3:44 pm

Yeah, there are always multiple ways that people will use tools. I wouldn't mind an optional setting to tell Ranorex what to do on an empty set, maybe that is the best way to do it?

Something like this:
ON EMPTY DATASET:
  • Do not run testcase
    Run testcase once
    Report warning
    Throw error
If you want to make a feature request for something like this, please send an email directly to Ranorex at [email protected]. They only take feature requests through email.


Having said that, they are planning a pretty massive rework on data connectors shortly, according to their roadmap. So, this discussion may be a moot point.

EDIT: The above list would need to be set for each data connector, so there might be more work that needs to be done to make it functional that would preclude it being a realistic possibility.
Shortcuts usually aren't...

dochoa
Posts: 29
Joined: Tue Jul 16, 2013 11:36 pm

Re: Report: Warning-sign/color missing if data source empty

Post by dochoa » Wed Dec 07, 2016 8:07 pm

What would the C# code look like to check if the data set is empty?
I can't find it.

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Report: Warning-sign/color missing if data source empty

Post by krstcs » Wed Dec 07, 2016 9:28 pm

Ranorex does all the work on this for you, in the background, so there's no code needed unless you are re-implementing what Ranorex already does (which I would suggest is not a good idea).

Can you please explain in more detail exactly what you are looking for and how you intend to use it?
Shortcuts usually aren't...