Jenkins部署项目到远端的TOMCAT下并自动化测试
使用Jenkins做项目打包和部署,在上一篇文章写的有,本文主要讲在部署到TOMCAT SERVER上以后,项目正常运行,然后我执行自动化测试时,遇到下面的问题
09:58:43.947 INFO - Checking Resource aliases09:58:43.955 INFO - Command request: getNewBrowserSession[*firefox /usr/bin/firefox, http://XXXXXXXX:8080/TEST-GUI/, , addCustomRequestHeaders=true] on session null09:58:43.960 INFO - creating new remote session09:58:43.981 WARN - Caution: '/usr/bin/firefox': file is a script file, not a real executable. The browser environment is no longer fully under RC control09:58:43.997 INFO - Allocated session 7553cfee1b99480a8b03895157dd1790 for http://XXXXXXXX:8080/TEST-GUI/, launching...09:58:44.383 INFO - Preparing Firefox profile...09:59:04.653 ERROR - Failed to start new browser session, shutdown browser and clear all session datajava.lang.RuntimeException: Timed out waiting for profile to be created! at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:360) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:120) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:90) at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession(FirefoxChromeLauncher.java:412) at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRemoteSession(FirefoxLauncher.java:114) at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:381) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:125) at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:86) at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:811) at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:437) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:407) at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:151) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530) at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482) at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909) at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820) at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986) at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837) at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243) at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357) at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)09:59:04.662 INFO - Got result: Failed to start new browser session: Error while launching browser on session null09:59:14.752 INFO - Command request: shutDownSeleniumServer[, ] on session null
-rw-r--r-- 1 root root 4512 Aug 2 17:46 Test-Jenkins:1.log-rw-r--r-- 1 root root 6 Aug 2 11:47 Test-Jenkins:1.pid-rw------- 1 root root 8 Aug 2 10:26 passwd-rwxr-xr-x 1 root root 352 Aug 2 11:47 xstartup-rwxr-xr-x 1 root root 654 Aug 2 11:20 xstartup_bk_original
$>export DISPLAY=:1$>firefox
## Type: string## Default: "jenkins"## ServiceRestart: jenkins## Unix user account that runs the Jenkins daemon# Be careful when you change this, as you need to update# permissions of $JENKINS_HOME and /var/log/jenkins.##JENKINS_USER="jenkins"JENKINS_USER="root"