Implementing a Keyword in Silk4NET

Before implementing a keyword, define the keyword as part of a keyword-driven test.

To implement a keyword for reuse in keyword-driven tests:

  1. Open a keyword-driven test that includes the keyword that you want to implement.
  2. In the Keyword-Driven Test Editor, click Implement Keyword to the left of the keyword that you want to implement. The Create a Keyword dialog box opens.
  3. Perform one of the following actions:
    • To record the keyword, click Record a keyword.
    • To create an empty keyword method, click Create an empty keyword method stub.
  4. Click OK.
  5. In the Save Keyword Implementation dialog box, define the name and location of the file into which you want to save the keyword implementation code and click Save.
  6. If you have set an application configuration for the current project and you are testing a web application, the Select Browser dialog box opens:
    1. Select the browser.
    2. Optional: If you want to test a web application on a desktop browser with a predefined browser size, select the browser size from the Browser size list.
      For example, to test a web application on Apple Safari and in a browser window which is as big as the screen of the Apple iPhone 7, select Apple iPhone 7 from the list.
    3. Optional: Select an Orientation for the browser window.
    4. Optional: Click Edit Browser Sizes to specify a new browser size and to select which browser sizes should be shown in the Browser size list.
  7. Click Record.
    For additional information on recording, see Recording a Keyword.