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: 1 addition & 1 deletion dotnet/src/webdriver/Alert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void SendKeys(string keysToSend)
throw new ArgumentNullException(nameof(keysToSend), "Keys to send must not be null.");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("text", keysToSend);

this.driver.Execute(DriverCommand.SetAlertValue, parameters);
Expand Down
20 changes: 10 additions & 10 deletions dotnet/src/webdriver/Chromium/ChromiumDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public ChromiumNetworkConditions NetworkConditions
throw new ArgumentNullException(nameof(value), "value must not be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["network_conditions"] = value;

this.Execute(SetNetworkConditionsCommand, parameters);
Expand All @@ -240,7 +240,7 @@ public void LaunchApp(string id)
throw new ArgumentNullException(nameof(id), "id must not be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["id"] = id;

this.Execute(LaunchAppCommand, parameters);
Expand All @@ -264,9 +264,9 @@ public void SetPermission(string permissionName, string permissionValue)
throw new ArgumentNullException(nameof(permissionValue), "value must not be null");
}

Dictionary<string, object> nameParameter = new Dictionary<string, object>();
Dictionary<string, object?> nameParameter = new Dictionary<string, object?>();
nameParameter["name"] = permissionName;
Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["descriptor"] = nameParameter;
parameters["state"] = permissionValue;
this.Execute(SetPermissionCommand, parameters);
Expand All @@ -279,14 +279,14 @@ public void SetPermission(string permissionName, string permissionValue)
/// <param name="commandParameters">Parameters of the command to execute.</param>
/// <returns>An object representing the result of the command, if applicable.</returns>
/// <exception cref="ArgumentNullException">If <paramref name="commandName"/> is <see langword="null"/>.</exception>
public object? ExecuteCdpCommand(string commandName, Dictionary<string, object> commandParameters)
public object? ExecuteCdpCommand(string commandName, Dictionary<string, object?> commandParameters)
{
if (commandName == null)
{
throw new ArgumentNullException(nameof(commandName), "commandName must not be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["cmd"] = commandName;
parameters["params"] = commandParameters;
Response response = this.Execute(ExecuteCdp, parameters);
Expand Down Expand Up @@ -404,7 +404,7 @@ public void SelectCastSink(string deviceName)
throw new ArgumentNullException(nameof(deviceName), "deviceName must not be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["sinkName"] = deviceName;
this.Execute(SelectCastSinkCommand, parameters);
}
Expand All @@ -420,7 +420,7 @@ public void StartTabMirroring(string deviceName)
throw new ArgumentNullException(nameof(deviceName), "deviceName must not be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["sinkName"] = deviceName;
this.Execute(StartCastTabMirroringCommand, parameters);
}
Expand All @@ -436,7 +436,7 @@ public void StartDesktopMirroring(string deviceName)
throw new ArgumentNullException(nameof(deviceName), "deviceName must not be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["sinkName"] = deviceName;
this.Execute(StartCastDesktopMirroringCommand, parameters);
}
Expand All @@ -462,7 +462,7 @@ public void StopCasting(string deviceName)
throw new ArgumentNullException(nameof(deviceName), "deviceName must not be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["sinkName"] = deviceName;
this.Execute(StopCastingCommand, parameters);
}
Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/CookieJar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public ReadOnlyCollection<Cookie> AllCookies
{
get
{
Response response = driver.Execute(DriverCommand.GetAllCookies, new Dictionary<string, object>());
Response response = driver.Execute(DriverCommand.GetAllCookies, new Dictionary<string, object?>());

List<Cookie> toReturn = new List<Cookie>();
if (response.Value is object?[] cookies)
Expand Down Expand Up @@ -63,7 +63,7 @@ public void AddCookie(Cookie cookie)
throw new ArgumentNullException(nameof(cookie));
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("cookie", cookie);
driver.Execute(DriverCommand.AddCookie, parameters);
}
Expand All @@ -80,7 +80,7 @@ public void DeleteCookieNamed(string name)
throw new ArgumentException("Cookie name cannot be null or empty", nameof(name));
}

Dictionary<string, object> parameters = new() { { "name", name } };
Dictionary<string, object?> parameters = new() { { "name", name } };

driver.Execute(DriverCommand.DeleteCookie, parameters);
}
Expand Down
6 changes: 3 additions & 3 deletions dotnet/src/webdriver/Firefox/FirefoxDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public FirefoxCommandContext GetContext()
public void SetContext(FirefoxCommandContext context)
{
string contextValue = context.ToString().ToLowerInvariant();
Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["context"] = contextValue;
this.Execute(SetContextCommand, parameters);
}
Expand Down Expand Up @@ -354,7 +354,7 @@ public string InstallAddOn(string base64EncodedAddOn, bool temporary = false)
throw new ArgumentNullException(nameof(base64EncodedAddOn), "Base64 encoded add-on must not be null or the empty string");
}

Dictionary<string, object> parameters = new Dictionary<string, object>
Dictionary<string, object?> parameters = new Dictionary<string, object?>()
{
["addon"] = base64EncodedAddOn,
["temporary"] = temporary
Expand All @@ -376,7 +376,7 @@ public void UninstallAddOn(string addOnId)
throw new ArgumentNullException(nameof(addOnId), "Base64 encoded add-on must not be null or the empty string");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["id"] = addOnId;
this.Execute(UninstallAddOnCommand, parameters);
}
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/ICustomDriverCommandExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public interface ICustomDriverCommandExecutor
/// <param name="parameters">A <see cref="Dictionary{K, V}"/> containing the names and values of the parameters of the command.</param>
/// <returns>An object that contains the value returned by the command, if any.</returns>
/// <exception cref="WebDriverException">The command returned an exceptional value.</exception>
object? ExecuteCustomDriverCommand(string driverCommandToExecute, Dictionary<string, object> parameters);
object? ExecuteCustomDriverCommand(string driverCommandToExecute, Dictionary<string, object?> parameters);

/// <summary>
/// Registers a set of commands to be executed with this driver instance.
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/Logs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public ReadOnlyCollection<LogEntry> GetLog(string logKind)

List<LogEntry> entries = new List<LogEntry>();

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("type", logKind);
Response commandResponse = this.driver.Execute(DriverCommand.GetLog, parameters);

Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/Navigator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public async Task GoToUrlAsync(string url)
throw new ArgumentNullException(nameof(url), "URL cannot be null.");
}

Dictionary<string, object> parameters = new Dictionary<string, object>
Dictionary<string, object?> parameters = new Dictionary<string, object?>
{
{ "url", url }
};
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/Remote/RemoteWebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public void DownloadFile(string fileName, string targetDirectory)
throw new WebDriverException("You must enable downloads in order to work with downloadable files.");
}

Dictionary<string, object> parameters = new Dictionary<string, object>
Dictionary<string, object?> parameters = new Dictionary<string, object?>
{
{ "name", fileName }
};
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/Safari/SafariDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void SetPermission(string permissionName, bool permissionValue)

Dictionary<string, object> permissions = new Dictionary<string, object>();
permissions[permissionName] = permissionValue;
Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters["permissions"] = permissions;
this.Execute(SetPermissionsCommand, parameters);
}
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/ShadowRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public IWebElement FindElement(By by)
throw new ArgumentNullException(nameof(by), "by cannot be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("id", this.shadowRootId);
parameters.Add("using", by.Mechanism);
parameters.Add("value", by.Criteria);
Expand All @@ -115,7 +115,7 @@ public ReadOnlyCollection<IWebElement> FindElements(By by)
throw new ArgumentNullException(nameof(by), "by cannot be null");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("id", this.shadowRootId);
parameters.Add("using", by.Mechanism);
parameters.Add("value", by.Criteria);
Expand Down
10 changes: 5 additions & 5 deletions dotnet/src/webdriver/TargetLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public TargetLocator(WebDriver driver)
/// <returns>A WebDriver instance that is currently in use</returns>
public IWebDriver Frame(int frameIndex)
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("id", frameIndex);
this.driver.Execute(DriverCommand.SwitchToFrame, parameters);
return this.driver;
Expand Down Expand Up @@ -112,7 +112,7 @@ public IWebDriver Frame(IWebElement frameElement)

Dictionary<string, object> elementDictionary = elementReference.ToDictionary();

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("id", elementDictionary);
this.driver.Execute(DriverCommand.SwitchToFrame, parameters);
return this.driver;
Expand All @@ -124,7 +124,7 @@ public IWebDriver Frame(IWebElement frameElement)
/// <returns>An <see cref="IWebDriver"/> instance focused on the specified frame.</returns>
public IWebDriver ParentFrame()
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
this.driver.Execute(DriverCommand.SwitchToParentFrame, parameters);
return this.driver;
}
Expand All @@ -142,7 +142,7 @@ public IWebDriver Window(string windowHandleOrName)
throw new ArgumentNullException(nameof(windowHandleOrName));
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("handle", windowHandleOrName);
try
{
Expand Down Expand Up @@ -190,7 +190,7 @@ public IWebDriver Window(string windowHandleOrName)
/// <returns>An <see cref="IWebDriver"/> instance focused on the new browser.</returns>
public IWebDriver NewWindow(WindowType typeHint)
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add("type", typeHint.ToString().ToLowerInvariant());

Response response = this.driver.Execute(DriverCommand.NewWindow, parameters);
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/Timeouts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void ExecuteSetTimeout(string timeoutType, TimeSpan timeToWait)
}
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
Dictionary<string, object?> parameters = new Dictionary<string, object?>();
parameters.Add(timeoutType, Convert.ToInt64(milliseconds));

this.driver.Execute(DriverCommand.SetTimeouts, parameters);
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/VirtualAuth/Credential.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public static Credential FromDictionary(Dictionary<string, object> dictionary)
/// Serializes this Credential instance to a dictionary.
/// </summary>
/// <returns>The dictionary containing the values for this Credential.</returns>
public Dictionary<string, object> ToDictionary()
public Dictionary<string, object?> ToDictionary()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
Dictionary<string, object?> toReturn = new Dictionary<string, object?>();

toReturn["credentialId"] = Base64UrlEncoder.Encode(this.id);
toReturn["isResidentCredential"] = this.IsResidentCredential;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ public VirtualAuthenticatorOptions SetIsUserVerified(bool isUserVerified)
/// Serializes this set of options into a dictionary of key-value pairs.
/// </summary>
/// <returns>The dictionary containing the values of this set of options.</returns>
public Dictionary<string, object> ToDictionary()
public Dictionary<string, object?> ToDictionary()
{
Dictionary<string, object> toReturn = new Dictionary<string, object>();
Dictionary<string, object?> toReturn = new Dictionary<string, object?>();

toReturn["protocol"] = this.protocol;
toReturn["transport"] = this.transport;
Expand Down
Loading
Loading