Global Parameter in Program File : General Questions

Global Parameter in Program File

Ask general questions here.

Global Parameter in Program File

Postby costamesakid » Fri Jul 08, 2011 12:41 am

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
costamesakid
 
Posts: 82
Joined: Tue Jun 16, 2009 11:27 pm

Re: Global Parameter in Program File

Postby Support Team » Fri Jul 08, 2011 11: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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Global Parameter in Program File

Postby costamesakid » Fri Jul 08, 2011 4: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
costamesakid
 
Posts: 82
Joined: Tue Jun 16, 2009 11:27 pm

Re: Global Parameter in Program File

Postby Support Team » Mon Jul 11, 2011 1: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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Global Parameter in Program File

Postby costamesakid » Mon Jul 11, 2011 4: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?
costamesakid
 
Posts: 82
Joined: Tue Jun 16, 2009 11:27 pm

Re: Global Parameter in Program File

Postby Support Team » Mon Jul 11, 2011 8: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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Global Parameter in Program File

Postby costamesakid » Tue Jul 12, 2011 4:49 pm

Exactly what I needed. Works great! Thanks
costamesakid
 
Posts: 82
Joined: Tue Jun 16, 2009 11:27 pm

Re: Global Parameter in Program File

Postby dman » Wed Sep 14, 2011 4: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.
dman
 
Posts: 24
Joined: Mon Aug 29, 2011 10:33 am
Location: München

Re: Global Parameter in Program File

Postby Support Team » Wed Sep 14, 2011 5: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
User avatar
Support Team
Site Admin
 
Posts: 4843
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Global Parameter in Program File

Postby dman » Wed Sep 14, 2011 5: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 (post10434.html#p10434)
dman
 
Posts: 24
Joined: Mon Aug 29, 2011 10:33 am
Location: München

Re: Global Parameter in Program File

Postby tracy91 » Fri Oct 28, 2011 3:10 pm

Hi, guys, registered to thank you cialis for the great solution provided in here. You've saved tones of my nerves and time
tracy91
 
Posts: 1
Joined: Fri Oct 28, 2011 3:07 pm


Return to General Questions

Who is online

Users browsing this forum: No registered users and 0 guests