Daily ChromeDriver updates

55 Views Asked by At

In the past our QA team used a PS1 script to download the latest ChromeDriver. Now the location to that chromedriver is here - https://googlechromelabs.github.io/chrome-for-testing/#stable. The downloadable is located in the list of links as the last one - https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6045.105/win64/chromedriver-win64.zip. The link changes as the version changes. Notice here the link has version 119.0.6045.105.

In an attempt to download the latest version when running automation and before we figure out how the newest version of selenium handles the driver, is it possible to get this link with a PS1 script still? I don't see a way that a wildcard can be used in the naming convention but there may be another solution. Any suggestions would be helpful thanks.

This works but only because I know the link.

$paths = "C:\WebDrivers\chromedriver-win64", "C:\WebDrivers\chromedriver.exe" foreach($filePath in $paths) { if (Test-Path $filePath) { Remove-Item $filePath -verbose } else { Write-Host "These were deleted successfully last pass" } } $client = new-object System.Net.WebClient $client.DownloadFile("https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6045.105/win64/chromedriver-win64.zip" , "C:\WebDrivers\chromedriver-win64.zip") Expand-Archive C:\WebDrivers\chromedriver-win64.zip Move-item -Path "C:\WebDrivers\chromedriver-win64\chromedriver-win64\chromedriver.exe" -Destination "C:\WebDrivers\chromedriver.exe"

Remove-Item -Path "C:\WebDrivers\chromedriver-win64.zip" -Verbose Remove-Item -Path "C:\WebDrivers\chromedriver-win64" -Recurse

0

There are 0 best solutions below