1I use Jenkins CI as build integration tool that runs on latest tomcat server 8. I run the selenium tests through command line .All tests are under xml file and that gets complied with java compiler with the help of command prompt.As soon as build gets fired up tests run automatically with the html report that will have screenshots of failed tests if it fail.
2. stale reference element error: this is something that stops the test flow when element is not found in the cache or in DOM .In order to get rid of it we can go with below work around:
a. Try to reidentify the element on which errors come up and then perform click operations.