Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
442 views
in Technique[技术] by (71.8m points)

protractor - How can I completely avoid webdriver-manager?

I'm trying to use protractor for e2e tests in my Angular project. I previously installed selenium server and chromedriver in my path and it works fine for non-angular projects. I do not have access to googleapis or any of the alternate cdns required by webdriver-manager.

How can I run protractor tests w/o involving webdriver-manager in any way? I want to use the tools I have installed globally. Is this a possibility?

When I try to run the ng e2e I get the error: Error message: Could not find update-config.json. Run 'webdriver-manager update' to download binaries.

When I try to run webdriver-manager update I get an http 403.

In my protractor.conf.js file I have directConnect: true and capabilities.browserName: 'chrome'

I was hoping that by using directConnect it would just find the chromedriver in my path but that isn't the case. In the past I would use the selenium-webdriver npm module to spin-up an instance of chrome driver.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Download latest selenium standalone server and chromedriver from https://www.seleniumhq.org/download/

Create a batch file

java -Dselenium.LOGGER.level=WARNING -Dwebdriver.chrome.driver="C:/Program Files (x86)/Selenium/WebDrivers/ChromeDrivers/2.38/chromedriver.exe" -jar selenium-server-standalone-3.4.0.jar -port 4444

specify the port,Chromedriver location and log level.

Just run the batch file and now you have selenium server running.

In your config file mention Selenium address 127.0.0.1:4444 or localhost


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...