No keyword with name '=' found in robot

前端 未结 3 1084
刺人心
刺人心 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:35

    ${reqresstr}= '${response["_object"]}'

    wrap it inside quotes and two spaces after =

    0 讨论(0)
  • 2021-01-27 01:40

    There is a syntax error in your command. Make sure there is a space between ${reqresstr} and =.

    Using your example above:

    ${reqresstr} =   ${response['_object']}
    
    0 讨论(0)
  • 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']}
    
    0 讨论(0)
提交回复
热议问题