运行量角器时,我在“错误”下面得到此信息。下面是我的Webstorm控制台中显示的错误。
“ C:\ Program Files(x86)\ JetBrains \ WebStorm 2016.2 \ bin \ runnerw.exe”“
C:\ Program Files \ nodejs \ node.exe” c:\ Users \ x216526 \ AppData \
Roaming \ npm \ node_modules \ protractor \ built \ cli.js C:\ Users \
x216526 \ workspace_Protractor \ SWA_Protractor \ conf.js [17:59:58] I /
direct-直接使用ChromeDriver … [17:59:58] I / launcher-正在运行1
WebDriver的实例[18:00:01] E /启动器-
会话未从未知错误创建异常:Runtime.executionContextCreated具有无效的’context’:{“ auxData”:{“
frameId”:“ 9784.1”,“ isDefault”:true },“ id”:1,“ name”:“”,“
origin”:“://”}(会话信息:chrome = 54.0.2824.0)(驱动程序信息:chromedriver =
2.22.397933(1cab651507b88dec79b2b2a22d1943c01833cc1b),平台= Windows NT
6.1。7601 SP1 x86_64)[18:00:01] E /启动程序-
SessionNotCreatedError:会话未创建,原因为未知错误:Runtime.executionContextCreated具有无效的’context’:{“
auxData”:{“ frameId”:“ 9784.1”,“ isDefault “:true},” id“:1,”
name“:”“,”起源“:”://“}(会话信息:chrome = 54.0.2824.0)(驱动程序信息:chromedriver =
2.22.397933(1cab651507b88dec79b2b2a22d1943c01833cc1b)在WebDriverError(c:\
Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \
node_modules \ selenium-webdriver \ lib \
error.js:26:26)处的WebDriverError(platform = Windows NT 6.1.7601 SP1
x86_64)(在SessionNotCreatedError( c:\ Users \ x216526 \ AppData \ Roaming \
npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ lib \
error.js:307:26),位于Object.checkLegacyResponse(c:\ Users \ x216526 \ AppData
\ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-
webdriver \ lib \ error.js:639:15)位于parseHttpResponse(c:\ Users \ x216526 \
AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \
selenium-webdriver \ http \ index.js:538:13)在c:\ Users \ x216526 \ AppData \
Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-
webdriver \ http \ index.js:472:11位于ManagedPromise.invokeCallback_(c:\ Users
\ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \
node_modules \ selenium-webdriver \ lib \
promise.js:1379:14),位于TaskQueue.execute_(c:\ Users \ x216526
\位于TaskQueue.executeNext_(c:\ Users \ x216526 \ AppData \ Roaming \ npm \
node_modules \ protractor \ node_modules \)的AppData \ Roaming \ npm \
node_modules \ protractor \ node_modules \ selenium-webdriver \ lib \
promise.js:2913:14 selenium-webdriver \ lib \ promise.js:2896:21)在c:\ Users
\ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \
node_modules \ selenium-webdriver \ lib \ promise.js:2820:25 at c:\ Users \
x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules
\ selenium-webdriver \ lib \
promise.js:639:7来自:任务:Function.createSession上的WebDriver.createSession()(c:\
Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \
node_modules \ selenium-webdriver \在Direct.getNewDriver(c:\ Users \ x216526
\ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \
selenium-webdriver \ chrome.js:778:38)处的lib \ webdriver.js:329:24) :\ Users
\ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ built \
driverProviders \ direct.js:68:26)在Runner.createBrowser(c:\ Users \ x216526
\ AppData \ Roaming \ npm \ node_modules \ protractor \ Built \
runner.js:187:43)在c:\ Users \ x216526 \ AppData \ Roaming \ npm \
node_modules \ protractor \ built \ runner.js:261:30 at _fulfilled(c:\ Users
\ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \
node_modules \ q \ q。 js:834:54)在self.promiseDispatch.done(c:\ Users \
x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules
\ q \ q.js:863:30)在Promise.promise.promiseDispatch(c :\ Users \ x216526 \
AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:796:13)位于c:\ Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \
protractor \ node_modules \ q \在runSingle(c:\ Users \ x216526 \ AppData \
Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:137:13)上的q.js:556:49 [18:00:01] E / launcher- “
process.on(’uncaughtException’”错误,请参阅启动器[18:00:01] E / launcher-
进程退出,错误代码为199进程完成,退出代码为19930 at _fulfilled(c:\ Users \ x216526 \ AppData \
Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:834:54)at self.promiseDispatch.done(c:\ Users \ x216526 \ AppData \
Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:863:30),位于Promise.promise.promiseDispatch(c:\ Users \ x216526 \ AppData
\ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \ q.js
:796:13)在runSingle(c:\ Users \ x216526 \ AppData \ Roaming \ npm \处位于c:\
Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \
node_modules \ q \ q.js:556:49 node_modules \ protractor \ node_modules \ q
\ q.js:137:13)[18:00:01] E / launcher-“
process.on(’uncaughtException’”)错误,请参阅启动器[18:00:01] E / launcher
-进程退出,错误代码为199进程结束,退出代码为19930 at _fulfilled(c:\ Users \ x216526 \ AppData \
Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:834:54)at self.promiseDispatch.done(c:\ Users \ x216526 \ AppData \
Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:863:30),位于Promise.promise.promiseDispatch(c:\ Users \ x216526 \ AppData
\ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \ q.js
:796:13)在runSingle(c:\ Users \ x216526 \ AppData \ Roaming \ npm \处位于c:\
Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \
node_modules \ q \ q.js:556:49 node_modules \ protractor \ node_modules \ q
\ q.js:137:13)[18:00:01] E / launcher-“
process.on(’uncaughtException’”)错误,请参阅启动器[18:00:01] E / launcher
-进程退出,错误代码为199进程结束,退出代码为199834:54)在self.promiseDispatch.done(c:\ Users \
x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules
\ q \ q.js:863:30)在Promise.promise.promiseDispatch(c:\ Users \ x216526 \
AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:796:13)位于c:\ Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \
protractor \ node_modules \ q \ q。 js:556:49在runSingle(c:\ Users \ x216526 \
AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:137:13)[18:00:01] E / launcher-“ process
.on(’uncaughtException’“错误,请参阅启动器[18:00:01] E / launcher-
进程退出,错误代码为199进程完成,退出代码为199834:54)在self.promiseDispatch.done(c:\ Users \
x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules
\ q \ q.js:863:30)在Promise.promise.promiseDispatch(c:\ Users \ x216526 \
AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:796:13)位于c:\ Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \
protractor \ node_modules \ q \ q。 js:556:49在runSingle(c:\ Users \ x216526 \
AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \
q.js:137:13)[18:00:01] E / launcher-“ process
.on(’uncaughtException’“错误,请参阅启动器[18:00:01] E / launcher-
进程退出,错误代码为199进程完成,退出代码为199\ Users \ x216526 \ AppData \ Roaming \ npm \
node_modules \ protractor \ node_modules \ q \ q.js:796:13)位于c:\ Users \
x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules
\ q \ q .js:556:49,位于runSingle(c:\ Users \ x216526 \ AppData \ Roaming \ npm
\ node_modules \ protractor \ node_modules \ q \ q.js:137:13)[18:00:01] E /
launcher-“ process.on(’uncaughtException’“错误,请参阅启动器[18:00:01] E / launcher-
进程退出,错误代码为199进程完成,退出代码为199\ Users \ x216526 \ AppData \ Roaming \ npm \
node_modules \ protractor \ node_modules \ q \ q.js:796:13)位于c:\ Users \
x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules
\ q \ q .js:556:49,位于runSingle(c:\ Users \ x216526 \ AppData \ Roaming \ npm
\ node_modules \ protractor \ node_modules \ q \ q.js:137:13)[18:00:01] E /
launcher-“ process.on(’uncaughtException’“错误,请参阅启动器[18:00:01] E / launcher-
进程退出,错误代码为199进程完成,退出代码为19901] E /启动程序-进程退出,错误代码为199进程完成,退出代码为19901] E /启动程序-
进程退出,错误代码为199进程完成,退出代码为199
我的配置js如下所示:
exports.config = {
directConnect: true, // Capabilities to be passed
//to the webdriver instance.
capabilities: { 'browserName': 'chrome', },
framework: 'jasmine2',
specs: ['./src/sli_sanitytests/San1_Check_
Sli_Homepage_is_Accessible_spec.js',
'./src/sli_sanitytests/San2_
Click_createButton_to_Open_Sli_CreateForm_page_spec.js',
'./src/sli_sanitytests/San3_
Create_Sli_reference_spec.js' ],
suites: {
smoke: ['./smoke/!*.spec.js'],
regression:['./regression/!*.spec.js'],
functional: ['./functional/!*.spec.js'],
all: ['./!*!/!*.spec.js'],
selected:['./functional/addcustomer.spec.js',
'./regression/openaccount.spec.js'],
},
// Options to be passed to Jasmine
jasmineNodeOpts: {
//onComplete will be called just before the driver quits.
onComplete: null,
// If true, display spec names.
isVerbose: true, // If true,print colors to the terminal.
showColors: true, // If true, include stack traces in
//failures.
includeStackTrace: true, // Default time to wait in ms
//before a test fails.
defaultTimeoutInterval: 80000
},
//enter code here
onPrepare:function() {
browser.ignoreSynchronization = true;
browser.driver.manage().window().maximize();
},
}
经过与上述问题的激烈斗争,我找到了解决方案。所以,请不要做任何事情。
首先,卸载您的Chrome浏览器,然后重新安装。量角器将不会抛出任何此类错误。
我什至不知道为什么会发生这种情况,以及出于什么原因看起来有些奇怪,但是,唯一的解决方案是卸载chrome浏览器并重新安装它。
npm卸载webdriver-manager -g npm安装webdriver-manager -g
问题内容: 我正在尝试开始使用Selenium,并下载了chrome驱动程序并放入了我的类路径中。我只是想立即获取标题,以查看是否可以使用它。当前代码如下: 我希望我的输出类似于“ Google”,但是却收到此错误: 我真的无法弄清楚该错误试图告诉我什么。是否是因为我在完全加载网站之前要求标题?我需要在之前添加某种命令吗? 问题答案: 此错误消息… …暗示 ChromeDriver 无法启动/产生
我正在尝试从命令行在windows上运行量角器 如果我直接键入命令: 它工作得很好。然而,从詹金斯内部,它一直在扔: 我的env-vars似乎还可以,因为Jenkins的java和npm工作得很好。有什么想法吗?
问题内容: 我想启动4个不同的Chrome窗口,以在4种分辨率下运行相同的测试。– 我知道量角器具有一项称为multiCapabilities的功能,并且我知道您可以像这样设置窗口大小: 但是我并没有真正找到将这两种方法结合起来的方法。还是有一种更简单的方法来创建这种行为 问题答案: 我想到的一个非常简单的解决方案是在测试文件中创建一个带有的循环,以使您的测试以不同的分辨率运行4次。 在您的规格开
问题内容: 在升级到Protractor 4.0.0并由于重大更改调整配置后,我们终于启动了测试。 现在的问题是,在测试运行后,它失败并显示: 如何调试此问题并了解是什么原因造成的? 试图在“疑难解答”模式下运行量角器: 但是得到了完全相同的输出,没有有关错误的详细信息。 问题答案: 目前,此问题已得到解决,应该很快就会有一个热修复。快速修补程序(在发布此修补程序之前)是更改node_module