WebDriver Placeholders

Placeholders are a way to parametrize your WebDriver scripts that allows you to use the same script (scenario) to test different services or with different credentials or testing various search results.
Placeholders are case sensitive.
URL
placeholder is not the same as
url
.
Page Contents
Using Placeholders in Script
Placeholders are replaced with their actual values in any place in the script - you can use them in the command arguments. Placeholders cannot be used in command names. There is a set of basic placeholders that are always present for any script but you can also add your own custom parameters. To employ a placeholder as the command argument, use
curly braces
around the placeholder name, like in this example:
<selenese> <command>open</command> <target><![CDATA[
{url}
]]></target> <value><![CDATA[]]></value> </selenese>
Here the
{url}
is a placeholder, that is replaced by the actual value (see below) on every run. This command will then open a page specified in the
{url}
parameter.
When you use a custom placeholder with the same name as a basic placeholder, then the custom placeholder value overrides the basic value.
Basic Placeholders
As described above, these are set for all WebDriver scripts even if you don’t specify any custom placeholders.
  • account or username
    - User name-value specified in the monitor settings (can be empty, either of these placeholders can be used - both have the same value)
  • passwd or password
    - Password value specified in the monitor settings (can be empty, either of these placeholders can be used - both have the same value)
  • uid
    - the account id owning the monitor (integer number, always set)
  • rid
    - the monitor id (integer number, always set, unique for each monitor)
  • host
    - Host value specified in monitor settings (can be empty)
  • port
    - Legacy (always “0” value)
  • path
    - Legacy (always empty)
Custom Placeholders
You can specify your own key/value pairs to use as placeholders in the “Script Parameters” monitor setting. This is useful when you need more than basic parameters or you need to override any of their values. Any values can be specified using the parameters field in the monitor settings.
The parameters field value needs to be constructed as parameters in URL, for example,
foo=bar&url=http%3A%2F%2Fwww.broadcom.com%2F
results in two placeholders available,
foo
having the value
bar
and
url
having the value
http://www.broadcom.com/
. Notice the values need to be url-encoded.
Custom placeholders are stored unencrypted, so using sensitive values (passwords) is discouraged.