No keyword with name found

454 views
Skip to first unread message

Anna Egorova

unread,
Mar 31, 2022, 3:26:32 PM3/31/22
to robotframework-users
Hi all. Cannot use keyword from custom library. Does anybody have any conclusions?

*.robot file:
*** Settings ***
Library    RequestsLibrary
Library    Collections
Library    JSONLibrary
Library    OperatingSystem
Library    ../../utilities/ResponseParser.py     #path is really right, when I typing in robot file - it recognises the keyword from the library
Resource    ../keywords.resource

*** Variables ***
${controller} product
${endpoint} lookup

*** Test Cases ***
TC_01_Product 
... 
${results}= generate expected result      ${controller}      ${endpoint}
...

ResponseParser.py
from robot.api.deco import library, keyword
@library
class ResponseParser:

    def __init__(self):
        self.driver = ""

    @keyword
    def generate_expected_result(self, controller, endpoint) -> dict:
        response = {controller: endpoint}
        return response

when I run test there is a message: No keyword with name 'generate expected result' found.

Hernandi Krammes

unread,
Apr 1, 2022, 2:24:44 PM4/1/22
to robotframework-users
With version of RF are you using?
pip freeze can give us this information.
@library is available from 3.2 on, accordingly with documentation.

Reply all
Reply to author
Forward
0 new messages