Global Parameter in Program File

Ask general questions here.
costamesakid
Posts: 94
Joined: Tue Jun 16, 2009 10:27 pm

Global Parameter in Program File

Post by costamesakid » Thu Jul 07, 2011 11:41 pm

Hello,

Is there anyway I can use a global parameter defined in my test case in my corresponding program.cs file for that test case?

For instance if I have global parameter 'repeats' set to a value of 10, is there any way I can set that global parameter to a variable defined in my program.cs file? Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Global Parameter in Program File

Post by Support Team » Fri Jul 08, 2011 10:05 am

Hi,
costamesakid wrote: Is there anyway I can use a global parameter defined in my test case in my corresponding program.cs file for that test case?
For instance if I have global parameter 'repeats' set to a value of 10, is there any way I can set that global parameter to a variable defined in my program.cs file? Thanks
Sorry but this is not possible. Do you want to repeat the whole test suite or only a few recordings?

Regards,
Peter
Ranorex Team

costamesakid
Posts: 94
Joined: Tue Jun 16, 2009 10:27 pm

Re: Global Parameter in Program File

Post by costamesakid » Fri Jul 08, 2011 3:55 pm

I want to be able to set the number of repeats for the entire test suite, per what test cases have been checked for execution. Thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Global Parameter in Program File

Post by Support Team » Mon Jul 11, 2011 12:29 pm

costamesakid wrote:I want to be able to set the number of repeats for the entire test suite, per what test cases have been checked for execution. Thanks
We already have a future request in our bug tracking system. As I said currently it is not possible to repeat the whole test suite. I would suggest you to create a parent (of all your children test cases) test-case with an empty data-connector.
Another hack would be to use a for loop in the program.cs. But as I said this is a hack and not recommended by us.

Regards,
Peter
Ranorex Team

costamesakid
Posts: 94
Joined: Tue Jun 16, 2009 10:27 pm

Re: Global Parameter in Program File

Post by costamesakid » Mon Jul 11, 2011 3:52 pm

Is there a way to bind a global parameter to a variable defined in a user code module? Currently it seems you can only bind global parameters to variables defined in the recording file?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Global Parameter in Program File

Post by Support Team » Mon Jul 11, 2011 7:41 pm

costamesakid wrote:Is there a way to bind a global parameter to a variable defined in a user code module?
Yes, after you created a test variable in the user code module, this works exactly the same as with variables in recordings. See following section in the Ranorex User Guide on how to create variables in a user code module:
http://www.ranorex.com/support/user-gui ... html#c3112

Regards,
Alex
Ranorex Team

costamesakid
Posts: 94
Joined: Tue Jun 16, 2009 10:27 pm

Re: Global Parameter in Program File

Post by costamesakid » Tue Jul 12, 2011 3:49 pm

Exactly what I needed. Works great! Thanks

dman
Posts: 64
Joined: Mon Aug 29, 2011 9:33 am
Location: München

Re: Global Parameter in Program File

Post by dman » Wed Sep 14, 2011 3:57 pm

Support Team wrote:See following section in the Ranorex User Guide on how to create variables in a user code module:
http://www.ranorex.com/support/user-gui ... html#c3112
...
Can't find the "Insert Module Variable" context menu entry in 3.1 - was it removed or am I missing some magic?

All the best,
D.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Global Parameter in Program File

Post by Support Team » Wed Sep 14, 2011 4:22 pm

Hi,

Do you have considered that you can only use this functionality (adding Module Variable) in UserCode Modules?
In the Recording files you have to add variables, which are basically the same as Module Variables.

Regards,
Markus
Ranorex Support Team

dman
Posts: 64
Joined: Mon Aug 29, 2011 9:33 am
Location: München

Re: Global Parameter in Program File

Post by dman » Wed Sep 14, 2011 4:28 pm

my bad - I tried in a recording's user code .cs file :oops:
in a user code module the menu entry is in its place

Thank you!
D.
p.s. trying to solve my global information access problem (http://www.ranorex.com/forum/post10434.html#p10434)

tracy91
Posts: 1
Joined: Fri Oct 28, 2011 2:07 pm

Re: Global Parameter in Program File

Post by tracy91 » Fri Oct 28, 2011 2:10 pm

Hi, guys, registered to thank you Hotel Thailand Directory for the great solution provided in here. You've saved tones of my nerves and time