Logs validations using ssh library in robot framework

I need to validate the trace/logs after hitting the post request from robot framework using ssh library.
Manually after sending the post request from postman, using putty validating the trace by using the commands to navigate to that trace/logs and validating the message. Can anyone help on automating this using robot framework. As of now, after post request im able to connect to server using open connection and login keywords hereafter i need to execute the commands

Hi Manivannan,

This thread has examples of using SSHLibrary to run commands and getting back the output from those commands:

The only thing I’d add to the info in that thread is if your manual step is to open the trace log with a text editor (e.g. vi or nano) and scroll through the text then you might be better off using other command lines to extract the detail you want.

  • grep/egrep can be used to extract text from a log that matches a pattern
  • tail will give you that last few lines of a log file (you can define the number of lines you want

Hopefully that will get you started,


Thanks Dave for your response, in my case i need to execute the putty commands like sudo -i, sudo localadmin when using same format mentioned in the thread getting status as 0 but not able to see the response. I need to execute 5 commands to reach the trace file