Ofcourse the webservice response is being checked on Ready API window, but as one of pre-requisite of my test case I have to make property changes, restart services and then send a SOAP request. Basically this is a negative test to verify SOAP response when server is down.
The answer to your question is yes - you can log into a Linux machine and execute commands through ReadyApi.
In order to execute a command you need to create a text file that contains the command. This file must be on the same machine as the ReadyApi application. You also need to have Putty on the same machine. Then you create a groovy script step and you can execute the command as:
ReadyApi can execute cmd commands through groovy script. Luckily, putty can be ran from cmd. 🙂
Follow the following steps to be able to run commands from ReadyApi in Linux machines:
1. Copy Putty on the same machine as ReadyApi.
2. Again, on the same machine as ReadyApi create text files containing your commands. Normally you can put multiple commands in the same ile when working with Linux but I can't guarantee that. You will need to try it yourself.
3. Open your ReadyApi project and add a step of type Groovyscript. The synthax for executing a cmd command is:
6. Please note that when using putty.exe you also need to specify the path to it. So this would look like
'cmd /c D:\\applications\\putty\\putty.exe...
The same goes for the file containing your commands.
7. If you don't want to worry about point 6, you can always add putty to your Windows path.
1. If you commit this project in git like this, you will also commit the username and password there, which is a bad practice.
2. Changing properties and restarting servers will increase your test duration. On the long run, it might be useful to find other solutions for this. (like putting property changes in the unit tests instead)
If my answer helped please click on the 'Accept as Solution' button.