"Runtime.executionContextCreated具有无效的'context'";我运行量角器时出错 [英] "Runtime.executionContextCreated has invalid 'context" error when i run Protractor

查看:44
本文介绍了"Runtime.executionContextCreated具有无效的'context'";我运行量角器时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行量角器时,我在错误"下面得到此信息.下面是我的Webstorm控制台中显示的错误.

I am getting this below Error while i run my protractor. And below is the error as shown in my webstorm console.

"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/启动器-运行1个WebDriver实例[18:00:01] E/启动器- 会话未从未知错误创建异常: Runtime.executionContextCreated具有无效的上下文": {"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具有无效的上下文": {"auxData":{"frameId":"9784.1","isDefault":true},"id":1,"name":","origin":://"} (工作阶段资讯:chrome = 54.0.2824.0)(驱动程式资讯: chromedriver = 2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),平台= Windows NT WebDriverError(c:\ Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ lib \ error.js:26:26)中的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 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ lib \ promise.js:2913:14) 在TaskQueue.executeNext_ (c:\ Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ 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 在 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 \ lib \ webdriver.js:329:24) 在司机处 (c:\ Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ selenium-webdriver \ chrome.js:778:38) 在Direct.getNewDriver (c:\ 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 在_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 \ q.js:556:49 在运行 (c:\ Users \ x216526 \ AppData \ Roaming \ npm \ node_modules \ protractor \ node_modules \ q \ q.js:137:13) [18:00:01] E/启动程序-"process.on('uncaughtException'"错误,请参见 启动器[18:00:01] E/启动器-进程退出,错误代码199 进程结束,退出代码为199

"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 - Using ChromeDriver directly... [17:59:58] I/launcher - Running 1 instances of WebDriver [18:00:01] E/launcher - session not created exception from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"9784.1","isDefault":true},"id":1,"name":"","origin":"://"} (Session info: chrome=54.0.2824.0) (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.1.7601 SP1 x86_64) [18:00:01] E/launcher - SessionNotCreatedError: session not created exception from unknown error: Runtime.executionContextCreated has invalid 'context': {"auxData":{"frameId":"9784.1","isDefault":true},"id":1,"name":"","origin":"://"} (Session info: chrome=54.0.2824.0) (Driver info: chromedriver=2.22.397933 (1cab651507b88dec79b2b2a22d1943c01833cc1b),platform=Windows NT 6.1.7601 SP1 x86_64) at WebDriverError (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:26:26) at SessionNotCreatedError (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:307:26) at Object.checkLegacyResponse (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\error.js:639:15) at parseHttpResponse (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:538:13) at c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\http\index.js:472:11 at ManagedPromise.invokeCallback_ (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1379:14) at TaskQueue.execute_ (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2913:14) at TaskQueue.executeNext_ (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2896:21) at 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 From: Task: WebDriver.createSession() at Function.createSession (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver.js:329:24) at Driver (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\chrome.js:778:38) at Direct.getNewDriver (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\driverProviders\direct.js:68:26) at Runner.createBrowser (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\built\runner.js:187:43) at 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) at self.promiseDispatch.done (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30) at Promise.promise.promiseDispatch (c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13) at c:\Users\x216526\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49 at 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'" error, see launcher [18:00:01] E/launcher - Process exited with error code 199 Process finished with exit code 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浏览器,然后重新安装.量角器将不会抛出任何此类错误.

First of all uninstall your chrome browser and reinstall it. That`s it protractor will not throw any such errors.

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

I even don`t know why this happened and for what reasons looks bit strange but yes the only solution is uninstall the chrome browser and reinstall it.

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

npm uninstall webdriver-manager -g npm install webdriver-manager -g

这篇关于"Runtime.executionContextCreated具有无效的'context'";我运行量角器时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆