如何将 Protractor 恢复到选定版本? [英] How can I revert Protractor back to a selected version?

查看:42
本文介绍了如何将 Protractor 恢复到选定版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前节点版本:V15.3.0当前 Webdriver-manager 版本:7.0.15

Current Node Version: V15.3.0 Current Webdriver-manager Version: 7.0.15

我不知所措.我的端到端自动化测试运行良好,直到我工作的公司将 Google Chrome 升级到 86.0.4240.111,之前我们使用的是 Chrome 83.所以很自然地在更新中我运行了以下命令 webdriver-manager update--versions.chrome=86.0.4240.111 但是后来当我尝试运行我的测试时,我收到错误消息,指出 ChromeDriver 仅支持 Chrome 版本 87.在此期间,我相信我有 Node 版本 V14.5.x或接近,Webdriver 是版本 6.14.x.

I am at a loss. My end-to-end automated testing was running great, until the company I work for upgraded Google Chrome to 86.0.4240.111, previously we were using Chrome 83. So naturally with the update I ran the following command webdriver-manager update --versions.chrome=86.0.4240.111 however afterwards when I attempted to run my testing, I received the error stating that ChromeDriver only supports Chrome version 87. During this time I believe I had Node version V14.5.x or close to, Webdriver was version 6.14.x.

我与 IT 部门进行了交谈,但我们无法从受信任的网站找到旧版本的 Chrome 来恢复 Google Chrome,因此我将 Node 和 npm 升级到上述当前版本.现在更新 Webdriver-manager 后,我收到错误消息,ChromeDriver 仅支持 Chrome 版本 87.我与 IT 人员交谈,他们不会升级到 87,即使它已于上周发布.

I talked with IT and we were unable to find an older version of Chrome from a trusted website to revert Google Chrome back, and so I upgraded Node and npm to the current versions stated above. Now after updating Webdriver-manager I get the error that ChromeDriver only supports Chrome version 87. I talked with IT and they will not upgrade to 87 even though it was released this past week.

我的问题是有任何可以安装 Node 和 NPM 的版本,我可以在其中使用我的测试与当前版本的 chrome 86.0.4240.111?

My question is there any version which I can install Node and NPM in which I can use my testing with the current version of chrome which is 86.0.4240.111?

我需要什么特定命令来安装所述版本.会是 npm install npm@[Enter Version Here] 吗?

And what specific commands would I need to install the said version. Would it be npm install npm@[Enter Version Here]?

感谢您花时间阅读并查看我的问题.如果需要更多信息,请告诉我,我将竭诚为您服务!

Thank you for taking the time to read and look at my question. If any more info is needed please let me know and I will gladly give you what I can!

推荐答案

  1. 节点版本无关紧要
  2. npm 版本无关紧要
  3. 您不需要还原量角器
  4. 出于安全考虑,很难降级您的浏览器.只能上版本,但是可以安装任何版本的chromedriver

您实际上需要做的是将本地chrome的版本与chromedriver的版本相匹配(驱动程序是控制浏览器的层,因此使它们相互对应很重要).所以

what you actually need to do is to match a version of your local chrome to the version of chromedriver (the driver is the layer that controls your browser, so it's important to make them correspond to each other). So

首先,找出您的 chrome 版本.从你的例子我明白它是 86.0.4240.111

First, find out what your version of chrome is. From your example I understand it is 86.0.4240.111

然后,找出可以使用的chromedriver版本.获取浏览器的主要版本(前 3 个数字,在您的情况下为 86.0.4240)并通过转到此 url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}(将主要浏览器版本而不是 ${CHROME_VERSION}).你会看到你正在寻找的 chromedriver 是 86.0.4240.22

Then, find out what chromedriver version can be used. Take the major version of the browser (first 3 numbers, 86.0.4240 in your case) and find the corresponding version of the driver by going to this url https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION} (put the major browser version instead of ${CHROME_VERSION}). You'll see the chromedriver you're looking for is 86.0.4240.22

这是最棘手的部分开始的地方.量角器通常有两种安装方式:

This is where the trickiest part begins. There are 2 installation of protractor usually:

  • 本地
  • 全球

如何查找你用的是哪一个我就不赘述了,你可以查一下.但是当你找到它时,请确保你更新的是正确的

I won't go over how to find which one you use, you can look it up. But when you find it, make sure you're updating the right one

当您知道要更新哪个量角器时,转到它的文件夹并从该文件夹运行 npm i webdriver-manager@latest 然后运行 ​​node ./bin/webdriver-manager 更新 --gecko=false

When you know which protractor you're updating, go to it's folder and from that folder run npm i webdriver-manager@latest and then node ./bin/webdriver-manager update --gecko=false

当你更新了正确的 webdriver 时,像这样安装正确的 chromedriver

when you updated the right webdriver, install the right chromedriver like so

node ./bin/webdriver-manager update --gecko=false --versions.chrome $VERSION

确保输入 86.0.4240.22 而不是 $VERSION

这篇关于如何将 Protractor 恢复到选定版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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