Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/scripts/github-actions/delete-browsers-drivers.ps1
11810 views
#!/usr/bin/env pwsh
#
# Delete pre-installed drivers so Selenium Manager downloads them. Unlike
# Linux/macOS, browsers are kept: removing them from Program Files is unreliable
# and a partial delete leaves a corrupt install that breaks the tests.

Write-Host "Removing pre-installed drivers"

$paths = @(
  $env:ChromeWebDriver,
  $env:EdgeWebDriver,
  $env:GeckoWebDriver
) | Where-Object { $_ }

if ($paths) {
  Remove-Item -Path $paths -Recurse -Force -ErrorAction SilentlyContinue
}