3

尝试在 Windows Jenkins 从属节点上的 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

这很奇怪,因为我可以使用任何其他浏览器运行相同的测试。以下是我尝试过的一些事情:

有什么我想念的吗?

4

3 回答 3

2

我发现阅读文档是一件好事 :) 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 值。

为我工作...

于 2015-10-02T19:53:54.163 回答
1

我在 Jenkins 下的量角器测试也遇到了问题,当我在控制台中运行测试时,一切都运行良好,但在 Jenkins 中却没有。事实证明,当 Jenkins 作为服务运行时,IEDriverServer 不起作用(这是 jenkins 窗口安装程序的默认设置)。对于 IE 测试,Jenkins MUST NOT RUN AS A SERVICE,而是必须关闭 Jenkins 服务并且 Jenkins 以

java -jar jenkins.war

(在 jenkins 目录中)(参见https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver

于 2016-08-16T14:43:24.410 回答
0

确保你的节点模块的版本,特别是 selenium,在本地机器和远程机器上是相同的。

于 2015-12-31T16:33:44.810 回答