Before you can set the values of variables for the execution of a keyword-driven test, you have to create the
project.
-
In the
Solution Explorer, expand the project which includes the keyword-driven tests that you want to execute based on the variables.
-
Right-click the
project node and select
.
The
Add New Item dialog box opens.
-
Select
from the item tree.
-
Select
Text File from the item list.
-
Type
globalvariables.properties into the
Name field.
-
Click
Add.
The new properties file opens.
-
Add new lines to the file to specify the variables.
The format for a new variable is:
name=value
For example, to specify the two variables
user and
password, type the following:
user=John
password=john5673
For information about the format of a properties file and how you can enter UNICODE characters, for example a space, see
Properties File Format.
-
Save the
globalvariables.properties file.
-
In the
Solution Explorer, right-click the
globalvariables.properties file and select
Properties.
The
Properties view opens.
-
In the
Properties view, expand the
Build Action list and select
Embedded Resource.
-
Open the keyword-driven test that you want to execute.
-
In theKeyword-Driven Test Editor, edit the parameters to use the new variables.
Use the following annotation:
${variable name}
For example, in the following keyword-driven test, the
${current user} parameter uses a global variable:
Whenever
a keyword-driven test in the project is executed from
Silk4NET, the variables are used.