How to Create a Global Counter

Ask general questions here.
Posts: 2
Joined: Tue Mar 17, 2020 8:21 pm

How to Create a Global Counter

Post by pmheys » Thu Jul 23, 2020 4:07 pm


I have a recording in my test suite that calls a piece of UserCode I have in a public UserCodeCollection in my project. When a certain condition is true in this code I want to increment a counter. This recording calling the usercode gets called several times in a row, and I want to find a way to carry over the value of the counter between times the usercode gets called. I tried using a global parameter and incrementing it in the UserCode, but that doesn't seem to carry over to the next time the code gets called. I've done some googling online but I haven't found anything particularly useful as of yet.

Is there a way in Ranorex to solve this situation?

Thanks a ton for the help!

User avatar
Certified Professional
Certified Professional
Posts: 222
Joined: Mon Jul 11, 2016 2:15 pm

Re: How to Create a Global Counter

Post by Vega » Thu Jul 23, 2020 5:52 pm

You can use a global parameter; the below chapters of the user guide should help you out as they explain how to pass data between modules during execution:
hope this helps