I am a recent Robot Framework user/developer. I have a custom library that needs to load an additional file from within a keyword method. If I log the {CURDIR} variable from within the running script, it correctly logs the directory that contains the running .robot file. If I use BuiltIn().get_variable_value("{CURDIR}") from within my Python library file, I get a return value of None. Is there something else I need to do to determine the test script’s location?
I should also add that other variables such as @{TEST TAGS} and ${TEST NAME} do return the expected values.
I have found that I can use os.path.dirname(BuiltIn().get_variable_value("${SUITE SOURCE}")) to get the proper location of the running script.
Hi,
welcome to forum!
I think the issue with ${CURDIR}
it always point to the current directory of the calling robot file.
In this case the calling file is not robot file, but python.