Page 1 of 1

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

Posted: Mon Aug 29, 2016 7:27 am
by BCTest
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
I would have found this issue faster if it was marked as a warning.

Regards,
Thomas

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

Posted: Mon Aug 29, 2016 2:37 pm
by krstcs
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 ).

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

Posted: Mon Aug 29, 2016 3:30 pm
by BCTest
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.

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

Posted: Mon Aug 29, 2016 3:44 pm
by krstcs
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.

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

Posted: Wed Dec 07, 2016 8:07 pm
by dochoa
What would the C# code look like to check if the data set is empty?
I can't find it.

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

Posted: Wed Dec 07, 2016 9:28 pm
by krstcs
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?