diff --git a/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs b/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs index fc792c3eb8f4..0b7e127b6f40 100644 --- a/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs +++ b/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs @@ -25,7 +25,13 @@ public void Cleanup() { File.Delete(_tempPath); } - driver.Quit(); + try + { + driver.Quit(); + } + catch (WebDriverException) + { + } } [TestMethod] @@ -56,13 +62,13 @@ public void SetBinary() } [TestMethod] - [Ignore("Not implemented")] public void LogsToFile() { var service = FirefoxDriverService.CreateDefaultService(); - //service.LogFile = _logLocation + service.LogPath = GetLogLocation(); driver = new FirefoxDriver(service); + driver.Quit(); var lines = File.ReadLines(GetLogLocation()); Assert.IsNotNull(lines.FirstOrDefault(line => line.Contains("geckodriver INFO Listening on"))); } @@ -85,15 +91,14 @@ public void LogsToConsole() } [TestMethod] - [Ignore("You can set it, just can't see it")] public void LogsLevel() { var service = FirefoxDriverService.CreateDefaultService(); - //service.LogFile = _logLocation - + service.LogPath = GetLogLocation(); service.LogLevel = FirefoxDriverLogLevel.Debug; driver = new FirefoxDriver(service); + driver.Quit(); var lines = File.ReadLines(GetLogLocation()); Assert.IsNotNull(lines.FirstOrDefault(line => line.Contains("Marionette\tDEBUG"))); } @@ -171,7 +176,7 @@ public void InstallUnsignedAddon() private string GetLogLocation() { - if (_logLocation != null && !File.Exists(_logLocation)) + if (string.IsNullOrEmpty(_logLocation) && !File.Exists(_logLocation)) { _logLocation = Path.GetTempFileName(); }