No keyword with name '=' found in robot

前端 未结 3 1083
刺人心
刺人心 2021-01-27 01:20

I\'m writing a test case in robot framework. I\'m getting the response in below json string:

{\"responseTimeStamp\":\"1970-01-01T05:30:00\",
 \"statusCode\":\"20         


        
3条回答
  •  情话喂你
    2021-01-27 01:41

    When using the "=" for variable assignment with the space separated format you must make sure you only have a single space surrounding the "=". Your first example shows that you've got more than one space on either side of the "=". You must have only a single space on either side, or robot will think the spaces are a separator between a keyword and argument.

    For the "keyword must not be empty" error, the first cell after a variable name must be a keyword. Unlike traditional programming languages, you cannot directly assign a string to a variable.

    To set a variable to a string you need to use the Set Variable keyword (or one of the variations such as Set Test Variable). For example:

    ${reqresstr}=      Set variable  ${response['_object']}
    

提交回复
热议问题