How-to
Test account values in steps
Test account values in steps
Test account values in steps inject login or password into Value without storing the secret in step text. Source TEST_ACCOUNT reads an account field from the running CASE; source INLINE stores the string on the step itself.
Prerequisites
- The project has a test account with
loginand, when needed,passwordfilled. - The queued
CASEautotest is bound to that account. - The step uses an action that allows
TEST_ACCOUNT(see the catalog in Autotest step).
Steps
- Open the
CASEcard and bind a test account if it is not bound yet. - Open a step that has Value (
fill,type,press,selectOption,toHaveText,toHaveAttribute, and other actions where the source is allowed). - Set Value source to
TEST_ACCOUNT. - In Value, set the account field:
loginorpassword(not the secret itself). - Confirm Target is not a repository page on this step.
- Save the step.
At run time the worker substitutes the field value from the bound CASE account. COMMON steps with TEST_ACCOUNT also use that CASE account.
INLINE and TEST_ACCOUNT
| Source | What you store on the step | What the worker gets |
|---|---|---|
INLINE | Value text | The same text |
TEST_ACCOUNT | Field name login or password | That field from the running CASE account |
Rules
- Kind
CASEmust have an account if any step in the chain (includingCOMMONpredecessors) requestsTEST_ACCOUNT. Otherwise the run fails. - Kind
COMMONhas no account of its own. When it runs as a predecessor, it uses fields from the queuedCASEaccount. TEST_ACCOUNTis forbidden forgoto,waitForURL,toHaveURL, andwaitForTimeout.TEST_ACCOUNTcannot be combined with a repository page Target on the same step.
Examples
Fill login and password
json
[
{
"action_name": "fill",
"target": { "kind": "LABEL", "value": "Email" },
"value_text": "login",
"value_source_type": "TEST_ACCOUNT",
"value_source_field": "login"
},
{
"action_name": "fill",
"target": { "kind": "LABEL", "value": "Password" },
"value_text": "password",
"value_source_type": "TEST_ACCOUNT",
"value_source_field": "password"
}
]INLINE for non-secret text
json
{
"action_name": "fill",
"target": { "kind": "LABEL", "value": "Search" },
"value_text": "login form",
"value_source_type": "INLINE"
}Forbidden actions
Do not set TEST_ACCOUNT on steps like this:
json
{
"action_name": "goto",
"value_text": "/login",
"value_source_type": "INLINE"
}Paths and URLs always use INLINE.
Did this page help?