I have two virtual machines running Windows Server 2012. One is running Jenkins, and another that is running one of Jenkins' build jobs. The job checks out test code from subversion and then runs mvn test -Dtest=com.package.name.TestName
in a windows batch script. The test compiles and runs, but fails with an ElementNotVisibleException
. These are TestNG tests with Selenium and a Firefox driver.
If I take the exact same command and run it from the Windows command line, the test succeeds. Another thing I notice is that when run from the command line, the browser window appears and I can watch it run through the test, but when run by Jenkins no window appears.
I found this question that suggests this is because our Jenkins is running as a service, and the tests are written to require a browser window in the foreground. Altering the tests to use a headless driver isn't an option for us, as that will result in inaccurate test results. Is there a way to get these tests working with Jenkins?