0

After every run i wish to delete all files that webdriver-manager downloaded as webdriver-manager start fails in subsequent runs inside proxy network. When i run webdriver-manager clean command in console it works fine but when the same command is run via nodejas it throws an error

command : npm run driver-clean script: driver-clean: 'webdriver-manager clean' Error : Error: EPERM: operation not permitted, unlink 'C:\mithun\ui-automation\node_modules\protractor\node_modules\webdriver-manager\selenium\chromedriver _75.0.3770.140.exe'

Mithun
  • 33
  • 2
  • 8

1 Answers1

0

The error is because the chromeDriver.exe instance is not closed after test run.Try to run the below command after your test

node ./node_modules/webdriver-manager/bin/webdriver-manager clean

OR

to kill your chrome driver from command line use : taskkill /im chromedriver.exe /f //To confirm the chrome driver name check task manager after starting the chrome driver.

Hope it helps you

Madhan Raj
  • 1,404
  • 1
  • 7
  • 13