Install Selenium (draft)

This commit is contained in:
Ivan Nosar
2019-12-19 16:19:58 +03:00
parent 89f3857d4b
commit 537e9da929
3 changed files with 33 additions and 0 deletions

View File

@@ -336,6 +336,12 @@
"{{ template_dir }}/scripts/Installers/Install-Firefox.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-Selenium.ps1"
]
},
{
"type": "powershell",
"scripts":[

View File

@@ -306,6 +306,12 @@
"{{ template_dir }}/scripts/Installers/Install-Firefox.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Install-Selenium.ps1"
]
},
{
"type": "powershell",
"scripts":[

View File

@@ -0,0 +1,21 @@
################################################################################
## File: Install-Selenium.ps1
## Desc: Install Selenium Server standalone
################################################################################
# Acquire latest Selenium release number from GitHub API
$latestReleaseUrl = "https://api.github.com/repos/SeleniumHQ/selenium/releases/latest"
$latestReleaseInfo = Invoke-RestMethod -Uri $latestReleaseUrl
$seleniumVersionString = $latestReleaseInfo.name.Split(" ")[1]
$seleniumVersion = [version]::Parse($seleniumVersionString)
# Download Selenium
Write-Host "Downloading selenium-server-standalone v$seleniumVersion..."
$seleniumReleaseUrl = "https://selenium-release.storage.googleapis.com/$($seleniumVersion.ToString(2))/selenium-server-standalone-$($seleniumVersion.ToString(3)).jar"
$seleniumBinPath = "C:\selenium\selenium-server-standalone.jar"
Invoke-WebRequest -UseBasicParsing -Uri $seleniumReleaseUrl -OutFile $seleniumBinPath
setx "CLASSPATH" "$($seleniumBinPath):$($env:CLASSPATH)" /M
exit 0