Page 1 of 1

Input parameters for recording.

Posted: Thu Jan 21, 2010 3:41 pm
by SpringMVC
Hello!
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!

Re: Input parameters for recording.

Posted: Thu Jan 21, 2010 4:16 pm
by Ciege
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...

Re: Input parameters for recording.

Posted: Thu Jan 21, 2010 4:28 pm
by Support Team
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 http://www.ranorex.com/support/user-gui ... 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.

Regards,
Alex
Ranorex Support Team