首页 > 解决方案 > 机器人框架在导入具有相关功能的 python 模块后给出“no keyword with name”错误

问题描述

测试.py

def test_method():
    print("hello")

回归机器人

*** Settings ***
Library               libs/Test.py

测试机器人

*** Settings ***
Resource              regression/regression.robot

*** Test Cases ***
Tvh1641513c

    Test Method

请参阅下面的文件夹结构。

我相信我正在正确地将模块导入机器人文件中。但我仍然收到错误“没有找到名称为'测试方法'的关键字”。如果有人可以就此提出建议,那将很有帮助。

标签: pythonrobotframework

解决方案


请参阅机器人框架用户指南

应该定义一个类test.py

class test:
    def test_keyword(self):
        print("hello")

推荐阅读