Skip to content

Commit

Permalink
Access web driver's properties only in try-catch (#1267)
Browse files Browse the repository at this point in the history
* Fix.
  • Loading branch information
ilonatommy authored Sep 14, 2024
1 parent 6d3cf4f commit 9a7efc6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ protected override async Task<ExitCode> InvokeInternal(ILogger logger)

// close all tabs before quit is a workaround for broken Selenium - GeckoDriver communication in Firefox
// https://github.com/dotnet/runtime/issues/101617
logger.LogInformation($"Closing {driver.WindowHandles.Count} browser tabs before setting the main tab to config page and quitting.");
var cts = new CancellationTokenSource();
cts.CancelAfter(10000);
try
{
logger.LogInformation($"Closing {driver.WindowHandles.Count} browser tabs before setting the main tab to config page and quitting.");
while (driver.WindowHandles.Count > 1 && driverService.IsRunning)
{
if (cts.IsCancellationRequested)
Expand Down

0 comments on commit 9a7efc6

Please sign in to comment.