【发布时间】:2021-12-06 22:56:42
【问题描述】:
Test.py
def test_method():
print("hello")
regression.robot
*** Settings ***
Library libs/Test.py
test.robot
*** Settings ***
Resource regression/regression.robot
*** Test Cases ***
Tvh1641513c
Test Method
请看下面的文件夹结构。
- 测试文件夹
- 库
- Test.py
- 资源
- 回归
- regression.robot
- 回归
- 测试
- test.robot
- 库
我相信我正确地导入了机器人文件中的模块。但我仍然收到错误“没有找到名称为'测试方法'的关键字”。如果有人可以就此提供建议,将会很有帮助。
【问题讨论】:
-
你试过在方法名前加 def 吗?:
def test_method(): print("hello") -
@AbdElRahmanZeid 是的。我已经添加了。
-
请显示实际错误。另外,请提供minimal reproducible example。您发布的代码均未调用
test_method或test method。 -
@BryanOakley 请查看更新的详细信息。
标签: python robotframework