Skip to content

Commit 9a7efc6

Browse files
authored
Access web driver's properties only in try-catch (#1267)
* Fix.
1 parent 6d3cf4f commit 9a7efc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Microsoft.DotNet.XHarness.CLI/Commands/WASM/Browser/WasmTestBrowserCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ protected override async Task<ExitCode> InvokeInternal(ILogger logger)
105105

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

0 commit comments

Comments
 (0)