Skip to content

Commit 7eb3a10

Browse files
committed
Quitting the driver to release the lock on the log file.
1 parent 8002489 commit 7eb3a10

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ public void Cleanup()
2525
{
2626
File.Delete(_tempPath);
2727
}
28-
driver.Quit();
28+
try
29+
{
30+
driver.Quit();
31+
}
32+
catch (WebDriverException)
33+
{
34+
}
2935
}
3036

3137
[TestMethod]
@@ -62,6 +68,7 @@ public void LogsToFile()
6268
service.LogPath = GetLogLocation();
6369

6470
driver = new FirefoxDriver(service);
71+
driver.Quit();
6572
var lines = File.ReadLines(GetLogLocation());
6673
Assert.IsNotNull(lines.FirstOrDefault(line => line.Contains("geckodriver INFO Listening on")));
6774
}
@@ -91,6 +98,7 @@ public void LogsLevel()
9198
service.LogLevel = FirefoxDriverLogLevel.Debug;
9299

93100
driver = new FirefoxDriver(service);
101+
driver.Quit();
94102
var lines = File.ReadLines(GetLogLocation());
95103
Assert.IsNotNull(lines.FirstOrDefault(line => line.Contains("Marionette\tDEBUG")));
96104
}

0 commit comments

Comments
 (0)