Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet] change source of navigation alias #13960

Merged
merged 1 commit into from
May 17, 2024
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
15 changes: 13 additions & 2 deletions dotnet/src/webdriver/Navigator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// </copyright>

using System;
using System.Collections.Generic;

namespace OpenQA.Selenium
{
Expand Down Expand Up @@ -58,7 +59,17 @@ public void Forward()
/// <param name="url">String of where you want the browser to go to</param>
public void GoToUrl(string url)
{
this.driver.Url = url;
if (url == null)
{
throw new ArgumentNullException(nameof(url), "URL cannot be null.");
}

Dictionary<string, object> parameters = new Dictionary<string, object>
{
{ "url", url }
};
this.driver.InternalExecute(DriverCommand.Get, parameters);

}

/// <summary>
Expand All @@ -72,7 +83,7 @@ public void GoToUrl(Uri url)
throw new ArgumentNullException(nameof(url), "URL cannot be null.");
}

this.driver.Url = url.ToString();
this.GoToUrl(url.ToString());
}

/// <summary>
Expand Down
12 changes: 1 addition & 11 deletions dotnet/src/webdriver/WebDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,7 @@ public string Url
return commandResponse.Value.ToString();
}

set
{
if (value == null)
{
throw new ArgumentNullException(nameof(value), "Argument 'url' cannot be null.");
}

Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("url", value);
this.Execute(DriverCommand.Get, parameters);
}
set => new Navigator(this).GoToUrl(value);
}

/// <summary>
Expand Down
Loading