Search code examples
python-3.xprocessrobotframeworkrobotframework-sshlibrary

Is there any Robot keyword for starting a server(.sh) script and capture the response in a text file or a variable?


I am having a ".sh" server script i want to run this file in my VM, after running i will send a curl request in my VM then this server will receive a response i want to capture the whole response in a file or variable. I have tried to run the server it was successful but i am stuck with how to capture the response also how to switch back to this server and capture the response after sending curl request.

CLI    COL_VM    cd server_path/                        prompt=$  timeout=30
${result}      CLI    COL_VM    ./server.sh             timeout_exception=0

where COL_VM is the device details which will help to login to that VM.


Solution

  • Instead of trying to capture the response from server, i captured the curl request's response itself.

    ${curl}      CLI    COL_VM    curl -X GET \http://localhost:8083/Path \ -d 'curl_request_json_which_we_are_sending'