angularjs - 如何在角度电话猫中运行量角器测试?
问题描述
我尝试执行 e2e 测试并得到一个错误:
Failed: unknown error: call function result missing 'value'
(Session info: chrome=68.0.3440.106)
(Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.15.0-32-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 9 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'egor-home', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-32-generic', java.version: '10.0.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac), userDataDir=/tmp/.org.chromium.Chromium.hBVoSN}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=68.0.3440.106, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 267829a52edfd44d3eedf3d8c565e1da
Github问题说错误“失败:未知错误:调用函数结果缺少'值'”可以通过chromedriver更新解决。但是错误消息中chromedriver版本为2.26.436382的问题,而node_modules中的版本:
node_modules/chromedriver/bin$ ./chromedriver --version
ChromeDriver 2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706)
我是对的,问题的根源是使用了错误版本的 chromedriver 吗?如何强制量角器使用最新版本?
解决方案
It looks like the angular-phonecat
git checkout gets an old version of protractor
and its inner webdriver_manager
(which contains the chromedriver
being used), causing your error. Running an update on the webdrive_manager
, chromedriver
or protractor
doesn't seem to grab the latest versions as their versions are managed by the ...\angular-phonecat\package.json
file. Edit the versions of the packages in this file and run npm install
. This should remove the old versions and pull the new versions for you.
I was also running an older version of Chrome and had to update this separately as each chromedriver
has a corresponding browser version that it is compatible with.
You can view the versions of the packages with npm v <package> version
.
My protractor
E2E tests passed with package versions of: protractor
5.4.0, chromedriver
2.41, webdriver-manager
12.1.0, alongside Chrome browser 69.0.3497.81
推荐阅读
- performance - 关于数据库事务性能的 Pentaho 表输出
- typescript - 如何使用 Material UI 和 TypeScript 将自定义道具传递给样式化组件?
- mysql - 如何在应用程序级别而不是数据库级别合并表数据库中的数据?
- aws-lambda - AWS lambda:RequestsDependencyWarning:urllib3 (1.26.6) 或 chardet (3.0.4) 与支持的版本不匹配
- php - 在使用版本控制维护模板的同时使用带有 dompdf 的 HTML 模板的最佳实践?
- c# - Unity 3D跳跃问题
- nginx - nginx:Expect 的行为:100-继续使用 HTTP 重定向
- uwp - 无法将 Microsoft.ProjectReunion 从 0.8.0-preview 升级到 0.8.0
- mongodb - 在没有 Mongo 副本集的情况下在开发和登台上设置自托管 RocketChat?
- python - 使用 Selenium Python单击多个元素