Try deleting cookie banner in case of an error
This commit is contained in:
parent
55ec81b4f0
commit
d50b9e97b3
1 changed files with 9 additions and 3 deletions
|
@ -23,11 +23,17 @@ function Install-AmdSoftwarePackage() {
|
|||
$summary.Click();
|
||||
}
|
||||
|
||||
if (($browser.FindElements([OpenQA.Selenium.By]::CssSelector($cookieBannerSelector))).Count -gt 0) {
|
||||
$browser.ExecuteScript("document.querySelector('$cookieBannerSelector').remove()");
|
||||
} else {
|
||||
$downloader = {
|
||||
param()
|
||||
$browser.FindElement([OpenQA.Selenium.By]::CssSelector($downloadSelector)).Click();
|
||||
}
|
||||
|
||||
try {
|
||||
$downloader.Invoke();
|
||||
} catch {
|
||||
$browser.ExecuteScript("document.querySelector('$cookieBannerSelector').remove()");
|
||||
$downloader.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
$file = Start-CustomDownload $context $url $action $tempDir;
|
||||
|
|
Loading…
Reference in a new issue