Colin Bowdery said:
I have web application testing which I am able to automate with Katalon. However, the server should be configured via SSH CLI prior to each test suite (i.e. set a configurable parameter which dictates how the web app reacts to test interactions).
Is it possible to SSH to the web server, issue a CLI command and gain the response prior to executing a test case (or Suite)?
Examples or pointers to documentation would be gratefully received!
SSH is totally different to web automation, make a bash script that does your SSH stuff for you and then calls the Katalon script once it is complete or you could even call the bash script to do your SSH stuff from a test case.
Something like this should do the trick, pipe your commands to SSH
cat your_commands_script.sh | email@example.com
Run the shell commands from the test case by adding something like this in the scripting mode.Not sure if it will need any imports so just press CTRL +SHIFT + O to sort your imports out incase ;)Runtime.getRuntime().exec('cat your_commands_script.sh | firstname.lastname@example.org')
Have to figure out some wizardy for confirmation your SSH command was successful, perhaps write back to a text file on the original server, which you test case checks before it continues. Or just delay a set amount of time if the command doesn't fail...