SAP UIVeri5 跳过检查 Google Chrome driver 版本检查的方法
生活随笔
收集整理的這篇文章主要介紹了
SAP UIVeri5 跳过检查 Google Chrome driver 版本检查的方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
由于眾所周知的原因,國內訪問 Google 某些網站時會遇到一些問題。而使用 SAP UIVeri5 時,在啟動階段,會自動連接 Google 網站檢測 Google Chrome driver 的最新版本,因而會遇到如下錯誤:
Error: Error while getting the latest version number for chromedriver.exe, error: Error: connect ECONNREFUSED 74.125.68.128:443
at _buildErrorObject (C:\app\node-v12.18.3-win-x64\node_modules@ui5\uiveri5\src\connection\latestDriverVersionResolver.js:90:10)
打開文件 latestDriverVersionResolver.js,找到檢測版本的代碼:
LatestDriverVersionResolver.prototype._getLatestMajorVersion = function (binary) {var that = this;return q.Promise(function (resolveFn, rejectFn) {if (!binary.useDirectUrl && binary.latestMajorVersionFileUrl) {that.logger.info('Check for latest major version of: ' + binary.filename);request({url: binary.latestMajorVersionFileUrl}, function (error, res, body) {if (_hasError(error, res)) {rejectFn(_buildErrorObject(error, res, binary.filename, 'the latest major version number'));} else {var latestMajorVersion = _parseVersionNumber(body, binary.version);that.logger.info('Found latest major version of ' + binary.filename + ': ' + latestMajorVersion);resolveFn({latestMajorVersion: latestMajorVersion});}});} else {resolveFn({});}}); };修改成:
LatestDriverVersionResolver.prototype._getLatestDriverVersion = function (binary) {var that = this;return q.Promise(function (resolveFn, rejectFn) {resolveFn({latestVersion: '92.0.4515.107'});}); };即不真正去檢查版本,而總是返回一個硬編碼的版本。
總結
以上是生活随笔為你收集整理的SAP UIVeri5 跳过检查 Google Chrome driver 版本检查的方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: git入门-基本操作与http/ssh连
- 下一篇: dr股票第二天会涨回来吗,不会