Skip to content

Commit

Permalink
Update ExecutingTestsOnWindowsGithubActions5.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
raczeja authored Jan 20, 2025
1 parent 4d213c2 commit cc663a4
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion scripts/ExecutingTestsOnWindowsGithubActions5.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,24 @@ echo "Selenium Grid hub started"
$appNode=Start-Process java -ArgumentList '-jar', $output, 'node --detect-drivers true' -RedirectStandardOutput "$outputLogs\console_node.out" -RedirectStandardError "$outputLogs\console_node.err" -PassThru

Start-Sleep -s 5
Invoke-RestMethod -Uri "http://localhost:4444/wd/hub/status"

$retryCount = 5
$delay = 5
for ($i = 0; $i -lt $retryCount; $i++) {
try {
$response = Invoke-RestMethod -Uri "http://localhost:4444/wd/hub/status"
if ($response.ready) {
Write-Output "Selenium Grid is ready."
break
}
} catch {
Write-Output "Attempt $($i + 1) failed. Retrying in $delay seconds..."
Start-Sleep -Seconds $delay
}
}
if ($i -eq $retryCount) {
Write-Output "Failed to connect to Selenium Grid after $retryCount attempts."
}
echo "Selenium Grid node started"

echo '********************************************Run tests with Selenium Grid ****************************************'
Expand Down

0 comments on commit cc663a4

Please sign in to comment.