簡體   English   中英

在Windows Jenkins從屬節點上運行Protractor時出現問題

[英]Problems running Protractor on a Windows Jenkins Slave Node

我試圖在Windows Jenkins Slave Node上運行IE11上的Protractor時遇到問題。

當我通過遠程桌面連接時,我能夠毫無問題地運行Protractor。 但是,當我嘗試從Jenkins運行Protractor時,我遇到了這個問題:

[launcher] Error: UnknownError: JavaScript error (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 396 milliseconds
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'Win7', ip: '142.133.132.199', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, enablePersistentHover=true, ie.forceCreateProcessApi=false, pageLoadStrategy=normal, ie.usePerProcessProxy=false, ignoreZoomSetting=false, handlesAlerts=true, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:12492/, takesScreenshot=true, javascriptEnabled=true, ignoreProtectedModeSettings=true, enableElementCacheCleanup=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=dismiss}]
Session ID: a43ccc90-f9f7-4465-98c3-dfb88751a5a9
    at new bot.Error (C:\Jenkins\workspace\sandbox\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:108:18)
    at Object.bot.response.checkResponse (C:\Jenkins\workspace\sandbox\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:109:9)
    at C:\Jenkins\workspace\sandbox\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:379:20
    at Array.forEach (native)
    at goog.async.run.processWorkQueue (C:\Jenkins\workspace\sandbox\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\async\run.js:130:15)
    at process._tickCallback (node.js:356:9)
[launcher] Process exited with error code 100

這很奇怪,因為我可以使用任何其他瀏覽器運行相同的測試。 以下是我嘗試的一些事情:

有什么我想念的嗎?

我發現閱讀文檔是件好事:) https://code.google.com/p/selenium/wiki/InternetExplorerDriver

閱讀配置部分

僅對於IE 11,您需要在目標計算機上設置一個注冊表項,以便驅動程序可以維護與其創建的Internet Explorer實例的連接。 對於32位Windows安裝,您必須在注冊表編輯器中檢查的密鑰是HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ Internet Explorer \\ Main \\ FeatureControl \\ FEATURE_BFCACHE。 對於64位Windows安裝,密鑰為HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Wow6432Node \\ Microsoft \\ Internet Explorer \\ Main \\ FeatureControl \\ FEATURE_BFCACHE。 請注意,FEATURE_BFCACHE子項可能存在也可能不存在,如果不存在,則應創建該子項。 要點:在此項中,創建名為iexplore.exe的值為0的DWORD值。

為我工作......

在Jenkins下我也有使用Protractor測試的問題,當我在控制台中運行測試時,一切都運行良好,但在Jenkins中沒有。 事實證明,當Jenkins作為服務運行時,IEDriverServer不起作用(這是jenkins窗口安裝程序的默認設置)。 對於IE測試,Jenkins不得作為服務運行 ,而是必須關閉Jenkins服務並且Jenkins開始使用

java -jar jenkins.war

(在jenkins目錄中)(參見https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

確保本地計算機和遠程計算機上的節點模塊版本(特別是selenium)相同。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM