Page 1 of 1

Need to clear static fields

Posted: Tue Jul 25, 2017 12:21 pm
by Shakib
Does Ranorex provide a feature through which static fields gets cleared automatically after completion of each test case or completion of each iteration?
If yes please provide the link or solution.

Re: Need to clear static fields

Posted: Tue Jul 25, 2017 12:31 pm
by odklizec
Hi,

I'm not quite sure what you mean by "clearing static fields"? If you want some sort of cleanup after finishing test, then no, there is no an automatic way to do this with Ranorex. You will have to define your own cleanup procedure (either using recordings or code modules). Ideally, you should use the same modules you already used for filling the fields with some content, just this time, use them to clean the inputs ;)

Re: Need to clear static fields

Posted: Tue Jul 25, 2017 1:29 pm
by Shakib
Below are the example:

Test Suite:
Test Case:(4 Iteration )
UserCodeModule1 (Declare static collections/variable and stores some value which we can use
in some other module for reference).

UserCodemodule2(Here we can use the static collections/variables for any operation.)

UserCodemodule3(Here also we can use the static collections/variables for any operation.)

EndCodeMoudle(Here we can clear the static field so that for next iteration value will not
cached in static collections or variable.)

I was thinking to clear static fields automatically so that we dont need to create a seperate module for getting
clear all static fields.
Might ranorex can provide the solution for this in future because it will effect more.
:)

Re: Need to clear static fields

Posted: Tue Jul 25, 2017 7:06 pm
by Support Team
Hello Shakib,

From the sound of your requirements, this is quite easy to implement yourself using a single module and [TEARDOWN] region. You will only need to maintain one module, which you can use throughout your test suite easily anytime it is needed. This also gives you much more control over when the data is initiated and cleared.
2017-07-25 13_57_18-SampleProject - Ranorex Studio (Administrator).png
Nonetheless, you can always make a feature request on our UserVoice platform.

Cheers,
Ned