Replaying a Keyword-Driven Test with Specific Variables

Before you can set the values of variables for the execution of a keyword-driven test, you have to create the project.
  1. In the Solution Explorer, expand the project which includes the keyword-driven tests that you want to execute based on the variables.
  2. Right-click the project node and select Add > New Item. The Add New Item dialog box opens.
  3. Select Installed > Common Items > General from the item tree.
  4. Select Text File from the item list.
  5. Type globalvariables.properties into the Name field.
  6. Click Add. The new properties file opens.
  7. 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.

  8. Save the globalvariables.properties file.
  9. In the Solution Explorer, right-click the globalvariables.properties file and select Properties. The Properties view opens.
  10. In the Properties view, expand the Build Action list and select Embedded Resource.
  11. Open the keyword-driven test that you want to execute.
  12. 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.