Error printing a response log from a Websocket in Robot framework

Viewed 25

I'm using robotframework-websocketclient 1.3.0 library to do tests on a Websocket, But when I tried to log the response from the websocket, the robot framework report displays the following error message: Resolving variable '${result.text}' failed: AttributeError: 'str' object has no attribute 'text'.

I used this same command (Log) from the BuiltIn library to print the log from a Rest api and it worked, but with websocket it's not working. Can anyone help?

*** Settings ***
Library    WebSocketClient
Library    Collections

*** Test Cases ***
Echo
    ${wuzu_websocket}=    WebSocketClient.Connect    wss://xxx.xxx.xxx.io/api/v1/ws
    # WebSocketClient.Send    ${wuzu_websocket}    Teste de conexão
    ${result}=    WebSocketClient.Recv    ${wuzu_websocket}
    Log                                   ${result.text}    
    # Should Be Equal    InvestmentCommitted    ${result}

    WebSocketClient.Close                 ${wuzu_websocket}

enter image description here

0 Answers
Related