rf-practice
Custom Keywords

Context

Keywords are the building blocks of Robot Framework. Besides using built-in and library keywords, you can define your own in the *** Keywords *** section. Custom keywords hide low-level details behind descriptive names, making suites easier to read and maintain.

Theory

A user keyword is defined by writing its name followed by indented keyword calls. Once defined, it can be called from any test case or from another keyword just like a built-in keyword. This turns repeated sequences into reusable, self-documenting actions.

Task

  • Create a *** Keywords *** section.
  • Define a keyword named Greet User that logs Hello, user!
  • Create a test case named Keyword Test that calls Greet User.

Checks

Defines a *** Keywords *** section
Defines a keyword named Greet User
Greet User logs Hello, user!
Has a test case named Keyword Test
Calls Greet User from the test case
Keyword Test passes