moved Selenium drivers installation to respective browsers

This commit is contained in:
Mikhail Timofeev
2020-03-06 13:33:25 +03:00
parent e031fd36fd
commit c647d2d4ef
7 changed files with 153 additions and 138 deletions

View File

@@ -0,0 +1,32 @@
################################################################################
## File: Install-SeleniumWebDrivers.ps1
## Desc: Install Selenium Web Drivers
################################################################################
$DestinationPath = "$($env:SystemDrive)\";
$DriversZipFile = "SeleniumWebDrivers.zip"
Write-Host "Destination path: [$DestinationPath]";
Write-Host "Selenium drivers download and install...";
try {
Invoke-WebRequest -UseBasicParsing -Uri "https://seleniumwebdrivers.blob.core.windows.net/seleniumwebdrivers/${DriversZipFile}" -OutFile $DriversZipFile;
}
catch {
Write-Error "[!] Failed to download $DriversZipFile";
exit 1;
}
$TempSeleniumDir = Join-Path $Env:TEMP "SeleniumWebDrivers"
Expand-Archive -Path $DriversZipFile -DestinationPath $Env:TEMP -Force;
Remove-Item $DriversZipFile;
$SeleniumWebDriverPath = Join-Path $DestinationPath "SeleniumWebDrivers"
$IEDriverPathTemp = Join-Path $TempSeleniumDir 'IEDriver'
if (-not (Test-Path -Path $SeleniumWebDriverPath)) {
New-Item -Path $SeleniumWebDriverPath -ItemType "directory"
}
Move-Item -Path "$IEDriverPathTemp" -Destination $SeleniumWebDriverPath
Write-Host "Setting the environment variables"
setx IEWebDriver "C:\SeleniumWebDrivers\IEDriver" /M;