Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dotnet/src/webdriver/IHasDownloads.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

using System.Collections.Generic;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions dotnet/src/webdriver/Remote/RemoteWebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,16 @@ public IReadOnlyList<string> GetDownloadableFiles()
throw new WebDriverException("GetDownloadableFiles returned successfully, but response content was not an object: " + commandResponse.Value);
}

object[] namesArray = (object[])value["names"]!;
return namesArray.Select(obj => obj.ToString()!).ToList();
object?[] namesArray = (object?[])value["names"]!;
return namesArray.Select(obj => obj!.ToString()!).ToList();
}

/// <summary>
/// Downloads a file with the specified file name.
/// </summary>
/// <param name="fileName">The name of the file to be downloaded.</param>
/// <param name="targetDirectory">The target directory where the file should be downloaded to.</param>
/// <exception cref="ArgumentNullException">If <paramref name="targetDirectory"/> is null.</exception>
public void DownloadFile(string fileName, string targetDirectory)
{
var enableDownloads = this.Capabilities.GetCapability(CapabilityType.EnableDownloads);
Expand Down