diff --git a/dotnet/src/webdriver/Logs.cs b/dotnet/src/webdriver/Logs.cs index 4ad943d9b7a44..6c903dccc9efd 100644 --- a/dotnet/src/webdriver/Logs.cs +++ b/dotnet/src/webdriver/Logs.cs @@ -76,29 +76,23 @@ public ReadOnlyCollection AvailableLogTypes public ReadOnlyCollection GetLog(string logKind) { List entries = new List(); - try - { - Dictionary parameters = new Dictionary(); - parameters.Add("type", logKind); - Response commandResponse = this.driver.InternalExecute(DriverCommand.GetLog, parameters); - object[] responseValue = commandResponse.Value as object[]; - if (responseValue != null) + Dictionary parameters = new Dictionary(); + parameters.Add("type", logKind); + Response commandResponse = this.driver.InternalExecute(DriverCommand.GetLog, parameters); + + object[] responseValue = commandResponse.Value as object[]; + if (responseValue != null) + { + foreach (object rawEntry in responseValue) { - foreach (object rawEntry in responseValue) + Dictionary entryDictionary = rawEntry as Dictionary; + if (entryDictionary != null) { - Dictionary entryDictionary = rawEntry as Dictionary; - if (entryDictionary != null) - { - entries.Add(LogEntry.FromDictionary(entryDictionary)); - } + entries.Add(LogEntry.FromDictionary(entryDictionary)); } } } - catch (NotImplementedException) - { - // Swallow for backwards compatibility - } return entries.AsReadOnly(); } diff --git a/dotnet/src/webdriver/Remote/W3CWireProtocolCommandInfoRepository.cs b/dotnet/src/webdriver/Remote/W3CWireProtocolCommandInfoRepository.cs index 384599ac6ef92..162add5ea0f45 100644 --- a/dotnet/src/webdriver/Remote/W3CWireProtocolCommandInfoRepository.cs +++ b/dotnet/src/webdriver/Remote/W3CWireProtocolCommandInfoRepository.cs @@ -133,6 +133,8 @@ protected override void InitializeCommandDictionary() // local-end implementation of WebDriver. this.TryAddCommand(DriverCommand.IsElementDisplayed, new HttpCommandInfo(HttpCommandInfo.GetCommand, "/session/{sessionId}/element/{id}/displayed")); this.TryAddCommand(DriverCommand.ElementEquals, new HttpCommandInfo(HttpCommandInfo.GetCommand, "/session/{sessionId}/element/{id}/equals/{other}")); + this.TryAddCommand(DriverCommand.GetLog, new HttpCommandInfo(HttpCommandInfo.PostCommand, "/session/{sessionId}/se/log")); + this.TryAddCommand(DriverCommand.GetAvailableLogTypes, new HttpCommandInfo(HttpCommandInfo.GetCommand, "/session/{sessionId}/se/log/types")); this.TryAddCommand(DriverCommand.UploadFile, new HttpCommandInfo(HttpCommandInfo.PostCommand, "/session/{sessionId}/se/file")); this.TryAddCommand(DriverCommand.GetDownloadableFiles, new HttpCommandInfo(HttpCommandInfo.GetCommand, "/session/{sessionId}/se/files")); this.TryAddCommand(DriverCommand.DownloadFile, new HttpCommandInfo(HttpCommandInfo.PostCommand, "/session/{sessionId}/se/files"));