I need a script or set of commands which can establish a remote connection with another server and execute some scripts over there. Basically it has to establish the connection with the remote server as an user ,say 'testuser' and then execute the script 'testscript'. and return the output to the parent server.
You can't just say "this script will run on another host". The script has to be locally available on the other host, either by copying it there or by a mounted remote share.
Run as './1.sh <user> <server>'. This will connect to the remote server and run the same code in 3 different variants. Choose the one that fits you best.