Context
Real test suites split reusable keywords into resource files so the same logic can be shared across many suites. One file defines the keywords, and another imports it with the Resource setting and calls them inside test cases.
Theory
A resource file is a normal Robot Framework file that contains keywords (and sometimes variables) but no test cases. The suite that wants to use those keywords imports the resource file with the Resource setting in the *** Settings *** section, then calls the imported keywords as if they were defined locally.
Task
- Open Library.robot and create a keyword named Greet User that logs Hello from library!
- Open Exercise.robot and add a *** Settings *** section that imports Library.robot with Resource Library.robot
- In Exercise.robot, create a test case named Resource Test that calls Greet User
Checks
Run your code to see terminal output.
Context
Real test suites split reusable keywords into resource files so the same logic can be shared across many suites. One file defines the keywords, and another imports it with the Resource setting and calls them inside test cases.
Theory
A resource file is a normal Robot Framework file that contains keywords (and sometimes variables) but no test cases. The suite that wants to use those keywords imports the resource file with the Resource setting in the *** Settings *** section, then calls the imported keywords as if they were defined locally.
Task
- Open Library.robot and create a keyword named Greet User that logs Hello from library!
- Open Exercise.robot and add a *** Settings *** section that imports Library.robot with Resource Library.robot
- In Exercise.robot, create a test case named Resource Test that calls Greet User