Knowing how to use variables is essential while working on WebTestware.
Following restrictions applies to variables.
Mention only variable name like var1 in Variable property wherever asked.
Use variable name with @ like @var1 if it needs to be used with other values.
1. Navigate based on variable value.
Now browser is navigated to variable value set rather than a constant URL.
2. Using variable in SQL query
select * from country where name = '@countryName'
3. Using variables in text
|Text||Name of the country is:@countryName|
Note that almost all Variable properties show all existing variable names in drop down.
Type 1: Variables are automatically created when used.
For example: Add Get Current URL action to a test method. Mention any name for Variable property. Variable with given name is created automatically and value is set when action is executed. Explicit variable declaration is not required.
Type 2: Explicitly add SetVariable action to create a new variable. This option is typically used for project settings etc.
Using variable actions
Use character ` (back-tick) to concatenate two variables
For example: if var1 value is 'abcd' and var2 value is 'xyz', then