Answer a question

I am currently trying to get some existing Protractor tests running properly for an app that I will be doing QA work for. However, it looks like I will need to use an earlier version of chromedriver to sync up with the version of Chrome I am using (71.x) but I am not sure how to get Protractor to use a different version as it always downloads v76. Why do I need to do this? Context below.

After pulling the code from the repository, I did an "npm install" in the "/e2e" directory according to the instructions left by the previous dev, as well as updating things through webdriver-manager using "webdriver-manager update." When running Selenium, I got the "Invalid or corrupt jar file" error that is apparently an issue with the 4.0.0-alpha-1 and alpha-2 versions, so I downgraded Selenium to the standalone version 3.141.59.

This worked until I realized that when running the tests, the app didn't recognize the browser as being Chrome and failed the tests (it requires Chrome to run) even though it was definitely running Chrome. So, I had to downgrade my local machine's version of Chrome down to match the chromedriver version that my update pulled - I believe it was running chromedriver v75 and I was running v76 on my local machine.

I was told by a QA colleague that I should be running Chrome v71.x since that is what we are using for our release pipeline. So, I uninstalled Chrome and got Chrome v71.x, making sure that auto-updating was disabled. This means I need to get the version of chromedriver that matches this, which appears to be v2.46 from the digging I did online.

Now, to my core issue. Every time I try to update things through webdriver-manager it always downloads the latest version of chromedriver (v76) and I don't know how to get Protractor to use an earlier version. I have downloaded chromedriver 2.46 manually - I am guessing I need to point it to this version somehow, but messing with the config json files has not yielded any luck for me and I haven't found a good answer online.

Any help is appreciated as I am still new to how all this works.

For reference, this is the type of error that pops up when I try to run my specs:

[08:25:41] E/launcher - SessionNotCreatedError: session not created: This 
version of ChromeDriver only supports Chrome version 76
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11- 
14T08:25:53'
System info: host: 'xxxxxxxx', ip: 'xxxxxxxx', os.name: 'Windows 
8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_40'
Driver info: driver.version: unknown

Answers

Your npm module will have folder as webdriver-manager. Here all binary ex chromedriver will be present.

Location:

/node_modules/protractor/bin/webdriver-manager

Now do below steps

  • Do webdriver-manager update

  • Now goto that folder and delete the chromedriver binary as per your OS i.e chromedriver.exe(Windows) and replace with it downgrade version of same which you will download from here, make sure name of the exe should be same as before Click Here

Run your test now

OR

To download a specific version of (for example) chromedriver:

webdriver-manager update --versions.chrome 2.46

webdriver-manager start --versions.chrome 2.46
Logo

Python社区为您提供最前沿的新闻资讯和知识内容

更多推荐