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.

When executing keyword-driven tests that are part of an automation framework and that are managed in a test management tool, for example Silk Central, you can set the values of any variables that are used for the execution of the keyword-driven test in Silk Test Classic. To set the values of global variables for the entire project, which means that these values are used whenever a Silk Test Classic user executes the keyword-driven test assets in this project, perform the following actions:

  1. Open the project that includes the keyword-driven test.
  2. Right-click the folder Data of the project and select New File. A new untitled file is opened in the editor.
  3. 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
  4. In the menu, click File > Save.
  5. Type globalvariables.properties into the File name field.
  6. Click Save.
  7. Open the keyword-driven test that you want to execute.
  8. 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 the keyword-driven test is executed from Silk Test Classic, the variables are used.

Note: When you replay a keyword-driven test, which is located in Silk Central, from Silk Test Classic, the result file (.xlg) is saved into the folder of the current Silk Test Classic project.