This is an example of a script that will start Sauce Connect, run your tests, and then close Sauce Connect afterwards. It relies on Bash and is designed to wrap around Maven. You could replace mvn clean test with your own test framework's command and experiment with the results.