0
votes

I tried calling the Python function using Get Library Instance Builtin Method of Robot Framework, but getting the error as "Keyword name cannot be empty". My Testcase code is

 *** Settings ***
Documentation  This is the register API testsuite
Library    ../../lib/ServerAPI.py  ${FEIP}  ${DBIP}   ${schemaid}   ${appid}   ${subscriber}

*** Test Cases ***
[TC-001]-Registering a device with INVALID SUBSCRIBER name to the server

     ${serverlib}=  Get Library Instance   ServerAPI
     log  ${serverlib}
     log  ${serverlib.subscriber}
     ${serverlib.register device}    ${token}   ${devid}

For the line ${serverlib.register device} ${token} ${devid}, i'm getting the error "Keyword name cannot be empty".register_device is one of the function in the file ServerAPI.py The log lines above log ${serverlib} is giving me ServerAPI object. I'm not sure if its the correct way to call the functions from a python Library.

1
It is not necessary to explicitly create instance (like ${serverlib}) for you purpose. Statement Library creates instance of your library and then you just call your keyword Register Device. - Jan Kovařík

1 Answers

1
votes

If register_device is a function in the library, you just call it directly:

Register device    ${token}    ${devid}