Skip to content

Commit 2199489

Browse files
Merge branch 'trunk' into nullable-misc
2 parents fa9d461 + 505b594 commit 2199489

20 files changed

+78
-349
lines changed

dotnet/src/support/UI/PopupWindowFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public string Invoke(Action popupMethod)
131131

132132
ReadOnlyCollection<string> existingHandles = this.driver.WindowHandles;
133133
popupMethod();
134-
WebDriverWait wait = new WebDriverWait(new SystemClock(), this.driver, this.timeout, this.sleepInterval);
134+
WebDriverWait wait = new WebDriverWait(SystemClock.Instance, this.driver, this.timeout, this.sleepInterval);
135135
string popupHandle = wait.Until<string>((d) =>
136136
{
137137
string? foundHandle = null;

dotnet/src/support/UI/SlowLoadableComponent{T}.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public abstract class SlowLoadableComponent<T> : LoadableComponent<T>
4343
/// </summary>
4444
/// <param name="timeout">The <see cref="TimeSpan"/> within which the component should be loaded.</param>
4545
protected SlowLoadableComponent(TimeSpan timeout)
46-
: this(timeout, new SystemClock())
46+
: this(timeout, SystemClock.Instance)
4747
{
4848
}
4949

dotnet/src/webdriver/Chrome/ChromeDriverService.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,22 @@ public static ChromeDriverService CreateDefaultService()
6363
/// </summary>
6464
/// <param name="driverPath">The path to the executable or the directory containing the ChromeDriver executable.</param>
6565
/// <returns>A ChromeDriverService using a random port.</returns>
66-
public static ChromeDriverService CreateDefaultService(string driverPath)
66+
public static ChromeDriverService CreateDefaultService(string? driverPath)
6767
{
68-
string fileName;
6968
if (File.Exists(driverPath))
7069
{
71-
fileName = Path.GetFileName(driverPath);
72-
driverPath = Path.GetDirectoryName(driverPath)!;
70+
string fileName = Path.GetFileName(driverPath);
71+
string driverFolder = Path.GetDirectoryName(driverPath)!;
72+
73+
return CreateDefaultService(driverFolder, fileName);
7374
}
7475
else
7576
{
76-
fileName = ChromiumDriverServiceFileName(DefaultChromeDriverServiceExecutableName);
77-
}
77+
string fileName = ChromiumDriverServiceFileName(DefaultChromeDriverServiceExecutableName);
78+
string? driverFolder = driverPath;
7879

79-
return CreateDefaultService(driverPath, fileName);
80+
return CreateDefaultService(driverFolder, fileName);
81+
}
8082
}
8183

8284
/// <summary>
@@ -85,7 +87,7 @@ public static ChromeDriverService CreateDefaultService(string driverPath)
8587
/// <param name="driverPath">The directory containing the ChromeDriver executable.</param>
8688
/// <param name="driverExecutableFileName">The name of the ChromeDriver executable file.</param>
8789
/// <returns>A ChromeDriverService using a random port.</returns>
88-
public static ChromeDriverService CreateDefaultService(string driverPath, string driverExecutableFileName)
90+
public static ChromeDriverService CreateDefaultService(string? driverPath, string? driverExecutableFileName)
8991
{
9092
return new ChromeDriverService(driverPath, driverExecutableFileName, PortUtilities.FindFreePort());
9193
}

dotnet/src/webdriver/Edge/EdgeDriverService.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,22 +72,24 @@ public static EdgeDriverService CreateDefaultService()
7272
/// <summary>
7373
/// Creates a default instance of the EdgeDriverService using a specified path to the EdgeDriver executable.
7474
/// </summary>
75-
/// <param name="driverPath">The directory containing the EdgeDriver executable.</param>
75+
/// <param name="driverPath">The path to the executable or the directory containing the EdgeDriver executable.</param>
7676
/// <returns>An EdgeDriverService using a random port.</returns>
77-
public static EdgeDriverService CreateDefaultService(string driverPath)
77+
public static EdgeDriverService CreateDefaultService(string? driverPath)
7878
{
79-
string fileName;
8079
if (File.Exists(driverPath))
8180
{
82-
fileName = Path.GetFileName(driverPath);
83-
driverPath = Path.GetDirectoryName(driverPath)!;
81+
string fileName = Path.GetFileName(driverPath);
82+
string driverFolder = Path.GetDirectoryName(driverPath)!;
83+
84+
return CreateDefaultService(driverFolder, fileName);
8485
}
8586
else
8687
{
87-
fileName = ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName);
88-
}
88+
string fileName = ChromiumDriverServiceFileName(MSEdgeDriverServiceFileName);
89+
string? driverFolder = driverPath;
8990

90-
return CreateDefaultService(driverPath, fileName);
91+
return CreateDefaultService(driverFolder, fileName);
92+
}
9193
}
9294

9395
/// <summary>
@@ -96,7 +98,7 @@ public static EdgeDriverService CreateDefaultService(string driverPath)
9698
/// <param name="driverPath">The directory containing the EdgeDriver executable.</param>
9799
/// <param name="driverExecutableFileName">The name of the EdgeDriver executable file.</param>
98100
/// <returns>A EdgeDriverService using a random port.</returns>
99-
public static EdgeDriverService CreateDefaultService(string driverPath, string driverExecutableFileName)
101+
public static EdgeDriverService CreateDefaultService(string? driverPath, string? driverExecutableFileName)
100102
{
101103
return new EdgeDriverService(driverPath, driverExecutableFileName, PortUtilities.FindFreePort());
102104
}

dotnet/src/webdriver/ElementNotSelectableException.cs

Lines changed: 0 additions & 63 deletions
This file was deleted.

dotnet/src/webdriver/ElementNotVisibleException.cs

Lines changed: 0 additions & 63 deletions
This file was deleted.

dotnet/src/webdriver/Firefox/FirefoxDriverService.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,22 @@ public static FirefoxDriverService CreateDefaultService()
194194
/// </summary>
195195
/// <param name="driverPath">The path to the executable or the directory containing the Firefox driver executable.</param>
196196
/// <returns>A FirefoxDriverService using a random port.</returns>
197-
public static FirefoxDriverService CreateDefaultService(string driverPath)
197+
public static FirefoxDriverService CreateDefaultService(string? driverPath)
198198
{
199-
string fileName;
200199
if (File.Exists(driverPath))
201200
{
202-
fileName = Path.GetFileName(driverPath);
203-
driverPath = Path.GetDirectoryName(driverPath)!;
201+
string fileName = Path.GetFileName(driverPath);
202+
string driverFolder = Path.GetDirectoryName(driverPath)!;
203+
204+
return CreateDefaultService(driverFolder, fileName);
204205
}
205206
else
206207
{
207-
fileName = FirefoxDriverServiceFileName();
208-
}
208+
string fileName = FirefoxDriverServiceFileName();
209+
string? driverFolder = driverPath;
209210

210-
return CreateDefaultService(driverPath, fileName);
211+
return CreateDefaultService(driverFolder, fileName);
212+
}
211213
}
212214

213215
/// <summary>
@@ -216,7 +218,7 @@ public static FirefoxDriverService CreateDefaultService(string driverPath)
216218
/// <param name="driverPath">The directory containing the Firefox driver executable.</param>
217219
/// <param name="driverExecutableFileName">The name of the Firefox driver executable file.</param>
218220
/// <returns>A FirefoxDriverService using a random port.</returns>
219-
public static FirefoxDriverService CreateDefaultService(string driverPath, string driverExecutableFileName)
221+
public static FirefoxDriverService CreateDefaultService(string? driverPath, string? driverExecutableFileName)
220222
{
221223
return new FirefoxDriverService(driverPath, driverExecutableFileName, PortUtilities.FindFreePort());
222224
}

dotnet/src/webdriver/IE/InternetExplorerDriverService.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,22 @@ public static InternetExplorerDriverService CreateDefaultService()
138138
/// </summary>
139139
/// <param name="driverPath">The path to the executable or the directory containing the <c>IEDriverServer</c> executable.</param>
140140
/// <returns>A InternetExplorerDriverService using a random port.</returns>
141-
public static InternetExplorerDriverService CreateDefaultService(string driverPath)
141+
public static InternetExplorerDriverService CreateDefaultService(string? driverPath)
142142
{
143-
string fileName;
144143
if (File.Exists(driverPath))
145144
{
146-
fileName = Path.GetFileName(driverPath);
147-
driverPath = Path.GetDirectoryName(driverPath)!;
145+
string fileName = Path.GetFileName(driverPath);
146+
string driverFolder = Path.GetDirectoryName(driverPath)!;
147+
148+
return CreateDefaultService(driverFolder, fileName);
148149
}
149150
else
150151
{
151-
fileName = InternetExplorerDriverServiceFileName;
152-
}
152+
string fileName = InternetExplorerDriverServiceFileName;
153+
string? driverFolder = driverPath;
153154

154-
return CreateDefaultService(driverPath, fileName);
155+
return CreateDefaultService(driverFolder, fileName);
156+
}
155157
}
156158

157159
/// <summary>
@@ -160,7 +162,7 @@ public static InternetExplorerDriverService CreateDefaultService(string driverPa
160162
/// <param name="driverPath">The directory containing the <c>IEDriverServer</c> executable.</param>
161163
/// <param name="driverExecutableFileName">The name of the <c>IEDriverServer</c> executable file.</param>
162164
/// <returns>A InternetExplorerDriverService using a random port.</returns>
163-
public static InternetExplorerDriverService CreateDefaultService(string driverPath, string driverExecutableFileName)
165+
public static InternetExplorerDriverService CreateDefaultService(string? driverPath, string? driverExecutableFileName)
164166
{
165167
return new InternetExplorerDriverService(driverPath, driverExecutableFileName, PortUtilities.FindFreePort());
166168
}

dotnet/src/webdriver/IWebElement.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ public interface IWebElement : ISearchContext
104104
/// <see cref="Keys"/>.</remarks>
105105
/// <seealso cref="Keys"/>
106106
/// <exception cref="InvalidElementStateException">Thrown when the target element is not enabled.</exception>
107-
/// <exception cref="ElementNotVisibleException">Thrown when the target element is not visible.</exception>
108107
/// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
109108
void SendKeys(string text);
110109

@@ -134,7 +133,6 @@ public interface IWebElement : ISearchContext
134133
/// simulate a users to accidentally missing the target when clicking.
135134
/// </para>
136135
/// </remarks>
137-
/// <exception cref="ElementNotVisibleException">Thrown when the target element is not visible.</exception>
138136
/// <exception cref="StaleElementReferenceException">Thrown when the target element is no longer valid in the document DOM.</exception>
139137
void Click();
140138

dotnet/src/webdriver/Response.cs

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,6 @@ public class Response
4040
Converters = { new ResponseValueJsonConverter() } // we still need it to make `Object` as `Dictionary`
4141
};
4242

43-
/// <summary>
44-
/// Initializes a new instance of the <see cref="Response"/> class
45-
/// </summary>
46-
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
47-
public Response()
48-
{
49-
}
50-
51-
/// <summary>
52-
/// Initializes a new instance of the <see cref="Response"/> class
53-
/// </summary>
54-
/// <param name="sessionId">Session ID in use</param>
55-
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
56-
public Response(SessionId? sessionId)
57-
{
58-
this.SessionId = sessionId?.ToString();
59-
}
60-
6143
/// <summary>
6244
/// Initializes a new instance of the <see cref="Response"/> class
6345
/// </summary>
@@ -66,11 +48,9 @@ public Response(SessionId? sessionId)
6648
/// <param name="status">The WebDriver result status of the response.</param>
6749
public Response(string? sessionId, object? value, WebDriverResult status)
6850
{
69-
#pragma warning disable CS0618 // Type or member is obsolete
7051
this.SessionId = sessionId;
7152
this.Value = value;
7253
this.Status = status;
73-
#pragma warning restore CS0618 // Type or member is obsolete
7454
}
7555

7656
/// <summary>
@@ -141,35 +121,17 @@ public static Response FromJson(string value)
141121
/// <summary>
142122
/// Gets or sets the value from JSON.
143123
/// </summary>
144-
public object? Value
145-
{
146-
get;
147-
148-
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
149-
set;
150-
}
124+
public object? Value { get; }
151125

152126
/// <summary>
153127
/// Gets or sets the session ID.
154128
/// </summary>
155-
public string? SessionId
156-
{
157-
get;
158-
159-
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
160-
set;
161-
}
129+
public string? SessionId { get; }
162130

163131
/// <summary>
164132
/// Gets or sets the status value of the response.
165133
/// </summary>
166-
public WebDriverResult Status
167-
{
168-
get;
169-
170-
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
171-
set;
172-
}
134+
public WebDriverResult Status { get; }
173135

174136
/// <summary>
175137
/// Returns a new <see cref="Response"/> from a JSON-encoded string.

0 commit comments

Comments
 (0)