Input parameters for recording.

Ask general questions here.
Posts: 3
Joined: Thu Jan 21, 2010 3:33 pm

Input parameters for recording.

Post by SpringMVC » Thu Jan 21, 2010 3:41 pm

I am a newbie for Ranorex and I like to know, if it is possible, to give some input parameters for text ( recording ).
For example, I have validation, which validates, if a window have text: "This will install Something 2.3.4v blah blah".
I need to replace it with for example "This will install {version} blah blah", and simply give "input parameter" with name version and value - Something 2.3.4v
So I can test different versions.
Any help would be highly appreciated!

User avatar
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Input parameters for recording.

Post by Ciege » Thu Jan 21, 2010 4:16 pm

Not sure if you can do that with the recorder or not (I don't use it). But it is simple enough to do in code. You can write your own method to either pass in the version # you want to check for, or if you want to get a little more daring you can write some RegEx code to filter the version information on the fly...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!


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

Re: Input parameters for recording.

Post by Support Team » Thu Jan 21, 2010 4:28 pm

The recommended way to support parameters for recordings is to create properties in the UserCode file and set these properties before you start the recording. Then convert the actions that should take parameters to User Code actions (see ... tions.html) and use the properties in there.

For your example, you should create a "Version" property of type string in the UserCode file of the recording and convert the Validation action to a User Code action. In the user code action change the code so the validation string uses the "Version" property.

Please, see the "Data Driven Sample" included with the Ranorex installation that illustrates the technique mentioned above.

Ranorex Support Team