Need to clear static fields

Ask general questions here.
Shakib
Posts: 31
Joined: Tue Jan 06, 2015 7:22 am

Need to clear static fields

Post by Shakib » Tue Jul 25, 2017 12:21 pm

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3932
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Need to clear static fields

Post by odklizec » Tue Jul 25, 2017 12:31 pm

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 ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Shakib
Posts: 31
Joined: Tue Jan 06, 2015 7:22 am

Re: Need to clear static fields

Post by Shakib » Tue Jul 25, 2017 1:29 pm

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.
:)

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Need to clear static fields

Post by Support Team » Tue Jul 25, 2017 7:06 pm

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
2017-07-25 13_57_18-SampleProject - Ranorex Studio (Administrator).png (5.09 KiB) Viewed 513 times
Nonetheless, you can always make a feature request on our UserVoice platform.

Cheers,
Ned
.
Image