diff --git a/scripts/Common/Scripts/BrowserAutomation.ps1 b/scripts/Common/Scripts/BrowserAutomation.ps1 index 5806fee9..53edadad 100644 --- a/scripts/Common/Scripts/BrowserAutomation.ps1 +++ b/scripts/Common/Scripts/BrowserAutomation.ps1 @@ -15,18 +15,10 @@ $null = New-Module { ) if (-not ("OpenQA.Selenium.Firefox.FirefoxDriver" -as [type])) { - $zipFile = [System.IO.Compression.ZipFile]::OpenRead((Get-Package Selenium.WebDriver).Source); - $webDriver = ($zipFile.Entries | Where-Object { $_.FullName -like "lib/net6.0/WebDriver.dll" })[0]; - $stream = [System.IO.MemoryStream]::new(); - $reader = [System.IO.StreamReader]($webDriver).Open(); - $reader.BaseStream.CopyTo($stream); - [byte[]]$bytes = $stream.ToArray(); - $reader.Close(); - $reader.Dispose(); - $stream.Close(); - $stream.Dispose(); - $zipFile.Dispose(); - $null = [System.Reflection.Assembly]::Load($bytes); + $packageRoot = Split-Path -Parent (Get-Package Selenium.WebDriver).Source; + $file = Join-Path $packageRoot "lib/netstandard2.0/WebDriver.dll"; + $env:SE_MANAGER_PATH = Join-Path $packageRoot "manager" ($IsWindows ? "windows" : "linux") "selenium-manager$($IsWindows ? ".exe" : '')"; + $null = [System.Reflection.Assembly]::LoadFile($file); } & $Action; diff --git a/scripts/Common/Scripts/Operations.ps1 b/scripts/Common/Scripts/Operations.ps1 index 1d7a7079..dd273709 100644 --- a/scripts/Common/Scripts/Operations.ps1 +++ b/scripts/Common/Scripts/Operations.ps1 @@ -229,7 +229,7 @@ $null = New-Module { if (-not (Test-PSPackage Selenium.WebDriver)) { Write-Host "Installing browser automation tools…"; - $null = Install-Package -Force Selenium.WebDriver -RequiredVersion 4.10.0 -SkipDependencies; + $null = Install-Package -Force Selenium.WebDriver -RequiredVersion 4.24.0 -SkipDependencies; continue; }