您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Jenkins調(diào)度Selenium腳本不打開瀏覽器解決辦法
作者:秋尋草 發(fā)布時間:[ 2016/7/27 14:36:24 ] 推薦標簽:功能測試 功能測試工具 Selenium

  The web browser doesn't show while run selenium test via jenkins
  原因:因為jenkins是用windows installer 安裝成 windows的服務了,那么jenkins是一個后臺服務,所以跑selenium cases 的時候不顯示瀏覽器
  解決辦法:
  Step 1. Control Panel(控制面板) -> Administrative Tools(管理工具) -> Services(服務)
  找到Jenkins,右鍵菜單,執(zhí)行stop; 右鍵菜單 “屬性” start type 選擇“Disabled”  點擊 應用,點擊確定。(這一步目的:讓jenkins不在以windows 服務的方式在后臺運行)
  Step2.  通過命令行啟動Jenkins
  java -jar "D:Program Files (x86)Jenkinsjenkins.war"
  當然,大家也可以做個bat文件,以后每次啟動jenkins,雙擊運行這個bat文件OK了,bat文件內(nèi)容如下:
  echo "Jenkins CI automation testting"
  java -jar "D:Program Files (x86)Jenkinsjenkins.war"
  pause
  Step3.  重新創(chuàng)建Jenkins的Job,重新配置,在執(zhí)行測試
  問題解決了。
  注意問題:
  (1)通過這種方式啟動jenkins,之前以windows service 啟動jenkins的數(shù)據(jù)都丟失了,需要重新創(chuàng)建job。
 。2)之前以windows service 啟動jenkins中安裝的插件也沒有了,需要重新安裝所需插件。
  其他參考:
  If you run Jenkins as a service in the background it won't open apps in the foreground. You may either try to run it not as a service in the foreground, or run it as a Local System account and check Allow the service to interact with desktop option. In the latter case you may get into permission problems, though.

軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd