diff --git a/scripts/Windows/Scripts/AmdSoftwarePackage.ps1 b/scripts/Windows/Scripts/AmdSoftwarePackage.ps1 index 690bb57b..dee4505f 100644 --- a/scripts/Windows/Scripts/AmdSoftwarePackage.ps1 +++ b/scripts/Windows/Scripts/AmdSoftwarePackage.ps1 @@ -9,8 +9,23 @@ function Install-AmdSoftwarePackage() { ) $tempDir = $context.GetTempDirectory(); - $selector = '.os-group:first-of-type .driver:first-of-type a:first-of-type'; - $file = Start-AutomatedDownload $context $url $selector $tempDir; + $osSelector = ".os-group:first-of-type"; + $summarySelector = "$osSelector summary:first-of-type"; + $downloadSelector = "$osSelector .driver:first-of-type a:first-of-type"; + + $action = { + param([OpenQA.Selenium.Firefox.FirefoxDriver] $browser) + + $summary = $browser.FindElement([OpenQA.Selenium.By]::CssSelector($summarySelector)); + + if (-not ([bool]$summary.GetAttribute("aria-expanded"))) { + $summary.Click(); + } + + $browser.FindElement([OpenQA.Selenium.By]::CssSelector($downloadSelector)).Click(); + } + + $file = Start-CustomDownload $context $url $action $tempDir; Start-Process -Wait -FilePath $file -ArgumentList "/S"; Remove-Item -Recurse $tempDir;