Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Robot framework resource file not found

I want to use a resource file with the name clean_environment.robot on windows. It is in the same folder like my robot file (C:\Users\xxxxx\Desktop\git\src), which is callig the resource file.

Basic file 30.robot:

** Settings **
Resource    clean_environment.robot

** Test Cases **
MyTestCase
    Clean environment

I get the error:

[ ERROR ] Error in file
'C:\Users\xxxxx\Desktop\git\src\30.robot': 
Resource file 'Clean environment' does not exist.

The resource file:

*** Settings ***

*** Test Cases ***
Clean environment
    Log to console    111

Edit: The computer said: Resource file 'Clean environment' does not exist! But 'Clean environment is not the resource file, it is the keyword right?

like image 408
kame Avatar asked Jun 23 '26 16:06

kame


1 Answers

If the file has a test case in it, it is not considered to be a resource file by robot. Resource files can only have keywords, variables and settings.

If you expect Clean environment to be a keyword, put it in a keyword table:

*** Keywords ***
Clean environment
    Log to console    1111
like image 155
Bryan Oakley Avatar answered Jun 27 '26 13:06

Bryan Oakley



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!