1

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.

gforceg
  • 421
  • 5
  • 8
  • directConnect works with binaries downloaded locally to your project. If you want to not use it, the logs from webdriver-manager tell you where to download it and how to run the java command. I have fixes coming for Protractor and webdriver-manager in January. – cnishina Dec 24 '18 at 09:08

3 Answers3

2

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

Bharath Kumar S
  • 1,410
  • 2
  • 10
  • 29
  • All of these answers are great. In my situation (archaic work environment) this is the best solution. – gforceg Nov 20 '18 at 01:38
2

you can use ng cli option: webdriver-update to make it not to execute webdriver update as following:

ng e2e --webdriver-update=false

But ng e2e uses the webdriver in local package not global package, I think you need a npm script to copy your pre-prepared webdriver to project local package before execute ng e2e --webdriver-update=false

yong
  • 13,357
  • 1
  • 16
  • 27
1

I think best way is either go for selenium grid(Dockerized Selenium or Jar based grid . Other option is

directConnect: true 

in your protractor config file.

Yash Jagdale
  • 1,446
  • 14
  • 17