Skip to content

Commit 8fba765

Browse files
committed
Removing obsolete end points for setting driver timeouts in .NET
1 parent 9daa6ce commit 8fba765

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

dotnet/src/webdriver/Remote/RemoteTimeouts.cs

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -59,29 +59,13 @@ public RemoteTimeouts(RemoteWebDriver driver)
5959
/// </remarks>
6060
public ITimeouts ImplicitlyWait(TimeSpan timeToWait)
6161
{
62-
// The *correct* approach to this timeout is to use the below
63-
// commented line of code and remove the remainder of this method.
64-
// However, we need to use the hard-coded timeout commmand for now,
65-
// since all drivers don't yet understand the generic "timeouts"
66-
// command endpoint.
67-
// this.ExecuteSetTimeout("implicit", timeToWait);
6862
double milliseconds = timeToWait.TotalMilliseconds;
6963
if (timeToWait == TimeSpan.MinValue)
7064
{
7165
milliseconds = -1;
7266
}
7367

74-
if (this.driver.IsSpecificationCompliant)
75-
{
76-
this.ExecuteSetTimeout("implicit", timeToWait);
77-
}
78-
else
79-
{
80-
Dictionary<string, object> parameters = new Dictionary<string, object>();
81-
parameters.Add("ms", milliseconds);
82-
this.driver.InternalExecute(DriverCommand.ImplicitlyWait, parameters);
83-
}
84-
68+
this.ExecuteSetTimeout("implicit", timeToWait);
8569
return this;
8670
}
8771

@@ -93,21 +77,13 @@ public ITimeouts ImplicitlyWait(TimeSpan timeToWait)
9377
/// <returns>A self reference</returns>
9478
public ITimeouts SetScriptTimeout(TimeSpan timeToWait)
9579
{
96-
// The *correct* approach to this timeout is to use the below
97-
// commented line of code and remove the remainder of this method.
98-
// However, we need to use the hard-coded timeout commmand for now,
99-
// since all drivers don't yet understand the generic "timeouts"
100-
// command endpoint.
101-
// this.ExecuteSetTimeout("script", timeToWait);
10280
double milliseconds = timeToWait.TotalMilliseconds;
10381
if (timeToWait == TimeSpan.MinValue)
10482
{
10583
milliseconds = -1;
10684
}
10785

108-
Dictionary<string, object> parameters = new Dictionary<string, object>();
109-
parameters.Add("ms", milliseconds);
110-
this.driver.InternalExecute(DriverCommand.SetAsyncScriptTimeout, parameters);
86+
this.ExecuteSetTimeout("script", timeToWait);
11187
return this;
11288
}
11389

0 commit comments

Comments
 (0)