When you need to add a little bit of extra functionality to a selenium script such as adding a random number you need to have a look at this:
http://release.openqa.org/selenium-core/0.8.0/reference.html#storedVars
Stored Variables
The commands store, storeValue and storeText can be used to store a variable value for later access. Internally, these variables are stored in a map called “storedVars”, with values keyed by the variable name. These commands are documented in the command reference.
Variable substitution
Variable substitution provides a simple way to include a previously stored variable in a command parameter. This is a simple mechanism, by which the variable to substitute is indicated by ${variableName}. Multiple variables can be substituted, and intermixed with static text.
Example:
store Mr title storeValue nameField surname store ${title} ${surname} fullname type textElement Full name is: ${fullname} Javascript evaluation
Javascript evaluation provides the full power of javascript in constructing a command parameter. To use this mechanism, the entire parameter value must be prefixed by ‘javascript{’ with a trailing ‘}’. The text inside the braces is evaluated as a javascript expression, and can access previously stored variables using the storedVars map detailed above. Note that variable substitution cannot be combined with javascript evaluation.
Example:
store javascript{’merchant’ + (new Date()).getTime()} merchantId type textElement javascript{storedVars['merchantId'].toUpperCase()}