| 120 | } |
| 121 | |
| 122 | private void ExecuteSetTimeout(string timeoutType, TimeSpan timeToWait) |
| 123 | { |
| 124 | double milliseconds = timeToWait.TotalMilliseconds; |
| 125 | if (timeToWait == TimeSpan.MinValue) |
| 126 | { |
| 127 | if (timeoutType == ImplicitTimeoutName) |
| 128 | { |
| 129 | milliseconds = DefaultImplicitWaitTimeout.TotalMilliseconds; |
| 130 | } |
| 131 | else if (timeoutType == AsyncScriptTimeoutName) |
| 132 | { |
| 133 | milliseconds = DefaultAsyncScriptTimeout.TotalMilliseconds; |
| 134 | } |
| 135 | else |
| 136 | { |
| 137 | milliseconds = DefaultPageLoadTimeout.TotalMilliseconds; |
| 138 | } |
| 139 | } |
| 140 | |
| 141 | Dictionary<string, object?> parameters = new Dictionary<string, object?>(); |
| 142 | parameters.Add(timeoutType, Convert.ToInt64(milliseconds)); |
| 143 | |
| 144 | this.driver.Execute(DriverCommand.SetTimeouts, parameters); |
| 145 | } |
| 146 | } |