Skip to content

Commit 2776b64

Browse files
committed
Adding default value to .NET IE element scroll behavior option
1 parent b1eff8a commit 2776b64

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

dotnet/src/webdriver/IE/InternetExplorerOptions.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ namespace OpenQA.Selenium.IE
2828
/// </summary>
2929
public enum InternetExplorerElementScrollBehavior
3030
{
31+
/// <summary>
32+
/// Indicates the behavior is unspecified.
33+
/// </summary>
34+
Default,
35+
3136
/// <summary>
3237
/// Scrolls elements to align with the top of the viewport.
3338
/// </summary>
@@ -126,7 +131,7 @@ public class InternetExplorerOptions : DriverOptions
126131
private TimeSpan fileUploadDialogTimeout = TimeSpan.MinValue;
127132
private string initialBrowserUrl = string.Empty;
128133
private string browserCommandLineArguments = string.Empty;
129-
private InternetExplorerElementScrollBehavior elementScrollBehavior = InternetExplorerElementScrollBehavior.Top;
134+
private InternetExplorerElementScrollBehavior elementScrollBehavior = InternetExplorerElementScrollBehavior.Default;
130135
private Dictionary<string, object> additionalCapabilities = new Dictionary<string, object>();
131136
private Dictionary<string, object> additionalInternetExplorerOptions = new Dictionary<string, object>();
132137

@@ -432,9 +437,16 @@ private Dictionary<string, object> BuildInternetExplorerOptionsDictionary()
432437
internetExplorerOptionsDictionary[InitialBrowserUrlCapability] = this.initialBrowserUrl;
433438
}
434439

435-
if (this.elementScrollBehavior == InternetExplorerElementScrollBehavior.Bottom)
440+
if (this.elementScrollBehavior != InternetExplorerElementScrollBehavior.Default)
436441
{
437-
internetExplorerOptionsDictionary[ElementScrollBehaviorCapability] = 1;
442+
if (this.elementScrollBehavior == InternetExplorerElementScrollBehavior.Bottom)
443+
{
444+
internetExplorerOptionsDictionary[ElementScrollBehaviorCapability] = 1;
445+
}
446+
else
447+
{
448+
internetExplorerOptionsDictionary[ElementScrollBehaviorCapability] = 0;
449+
}
438450
}
439451

440452
if (this.browserAttachTimeout != TimeSpan.MinValue)

0 commit comments

Comments
 (0)