Page 1 of 1

Progress dialog not correctly updated after SetRange

Posted: Mon Jun 17, 2013 9:59 am
by odklizec
Hi folks,

I'm currently working on a condition for our Ranorex/Jenkins builds, which should make the tests to use different data range for daily and for night builds. While the daily builds are much more frequent, we prefer to do only a basic "smoke" test (with just one or two elements), while the night builds are supposed to perform more thorough testing with extended/complete data range.

I was able to implement such condition using DataContext.SetRange function. However, I've noticed one weird behavior. The Ranorex progress dialog is not always updated.

Here is a screenshot from the below attached test project...
TestProgress.png
As you can see, the progress shows 1/10 range. The thing is, that the that actual range is limited to just 2 iterations and the test correctly ends after second iteration! It's just that the max range value (in progress dialog) is not updated.

Please try this project...
test.zip
Just run it and you should immediatelly see the problem.

It seems the problem is caused by "All Rows" option...
DataRange.png
If the Data Range is set to "All Rows" and then the data range is set somewhere from code, the max range value is not updated (in progress dialog).
If the Data Range is set using "From:" option, the max range value is updated correctly.

Hope it makes sense? ;)

Re: Progress dialog not correctly updated after SetRange

Posted: Mon Jun 17, 2013 12:44 pm
by odklizec
BTW, the above attached test project shows also another issue, that I did not experience before. From some unknown reasons, the report file shown after the end of test is not always the modern one (3.x/4.x compatible) but something I suspect is an old 2.x report format?...
OldReport.png
To reproduce this issue, run the above attached project (from RX Studio) multiple times in a row. Usually, for the first time it shows correct 4.x report...
NewReport.png
PS: I just remembered there was reported issue like this by someone else... http://www.ranorex.com/forum/extra-rxlo ... t4656.html

Sure enough, I'm using "Report.Log" in Program.cs in Wait_For_Available_License function. It's called before the TestSuite is initialized. But I'm using the same construction in production level test suite, where no "old format" report is created?

Re: Progress dialog not correctly updated after SetRange

Posted: Tue Jun 18, 2013 4:32 pm
by Support Team
Hello,

Thank you for reporting this issue.
I will add an entry in our internal bugtracking system in order to analyze it.

Please note that API methods are internal methods of Ranorex and can change every time a new version of Ranorex is released. Therefore, it is not recommended to use non supported API methods (internal methods).

Concerning your second issue:
If you are using Report.Log before the Test Suite is initialized, reports are generated in both formats (old 2.x style and new style). I have found reports in both styles using your solution.
Do you use the same Ranorex version in your production level test suite?

Regards,
Markus (T)

Re: Progress dialog not correctly updated after SetRange

Posted: Tue Jun 18, 2013 5:11 pm
by odklizec
Hi Markus,

Thanks for the response.

As for the first problem, could you please suggest me a better programmatic way to achieve my goal to use different data range for daily/night tests (other than to use internal APIs)? The test project I've uploaded is just a test, but it closely mimics what I want to achieve. I hope to use a global parameter, that I would pass via command line to a Jenkins-based test builds (different for day and night builds).

As for the report problem, please ignore it. It seems it was definitely caused by the "Report.Log" used before the test suite initialization. I was under the impression I'm using this line of code also in the production level test suite but I was wrong ;)

Re: Progress dialog not correctly updated after SetRange

Posted: Wed Jun 19, 2013 3:07 pm
by Support Team
Hello,

Would it be possible for you to create two different solutions (one for day and one for night)?
Then, you could simply define the data range differently for each solution in the properties.

Regards,
Markus (T)

Re: Progress dialog not correctly updated after SetRange

Posted: Wed Jun 19, 2013 3:31 pm
by odklizec
Hi Markus,

Thanks for the suggestion but I prefer to keep just one solution. The experience taught me that multiple projects/solutions are always harder to maintain. Therefore I'm looking for an option to switch the data range programmatically.

The current solution works quite OK (except the non-updated progress) so if there is no better option than to use two solutions, I will take the risk of using internal API. I believe it will still be easier to update the code (in case of changed API) than to maintain two solutions.

Re: Progress dialog not correctly updated after SetRange

Posted: Wed Sep 10, 2014 12:40 pm
by BorisS
Do you plan to fix this bug? I am still getting it with the Ranorex 5.1.2

Re: Progress dialog not correctly updated after SetRange

Posted: Thu Sep 11, 2014 10:15 am
by Support Team
Hello Boris,

This “bug” occurs because the “SetRange”-method is not used correctly.

Note: This is internal API. Therefore, it should be used with caution. Please keep in mind that we do not provide support for the Ranorex internal API because it can be changed at any time.

In order to change the Data range of your data connectors, please execute your test executables via command line.

The argument for changing the data range is the following:
testcasedatarange|tcdr:<name or guid of test case>=<data range>
Sets the data range for a testcase.
Further information about running Ranorex via command line can be found here:
http://www.ranorex.com/support/user-gui ... html#c3022

Regards,
Robert

Re: Progress dialog not correctly updated after SetRange

Posted: Thu Sep 11, 2014 2:58 pm
by BorisS
I need to see the same result disregarding whether a test suite is started from a command line or by clickiing the Run button. As I understood from your answer, that has to function with the right calls?

What they are? I see there is the routine "SetCurrentRange" or there is some other ways?

Re: Progress dialog not correctly updated after SetRange

Posted: Mon Sep 15, 2014 3:33 pm
by Support Team
Hi Boris,

Unfortunately, we do not support internal API. Therefore, we do not post internal API to our forum. It is not possible to define multiple data ranges for the same Test Case within Ranorex Studio.

Possible Workarounds:
  • • Duplicate the solution in order to set different data ranges
    • Execute the solution via command line using the “tcdr” argument
    • Create multiple Test Suite files using the Ranorex Test Suite Runner.
    • o Open the solution with the Ranorex Test Suite Runner.
      o Modify the Data Range of the specific connectors.
      o Save changes to a new *.rxtst file
Thank you for your understanding

Regards,
Robert