小编典典

当我运行量角器时,“ Runtime.executionContextCreated具有无效的'context”错误

angularjs

运行量角器时,我在“错误”下面得到此信息。下面是我的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(); 
               },
             }

阅读 208

收藏
2020-07-04

共1个答案

小编典典

经过与上述问题的激烈斗争,我找到了解决方案。所以,请不要做任何事情。

首先,卸载您的Chrome浏览器,然后重新安装。量角器将不会抛出任何此类错误。

我什至不知道为什么会发生这种情况,以及出于什么原因看起来有些奇怪,但是,唯一的解决方案是卸载chrome浏览器并重新安装它。

npm卸载webdriver-manager -g npm安装webdriver-manager -g

2020-07-04