Adding default value to .NET IE element scroll behavior option
@@ -28,6 +28,11 @@ namespace OpenQA.Selenium.IE
/// </summary>
public enum InternetExplorerElementScrollBehavior
{
+ /// <summary>
+ /// Indicates the behavior is unspecified.
+ /// </summary>
+ Default,
+
/// <summary>
/// Scrolls elements to align with the top of the viewport.
/// </summary>
@@ -126,7 +131,7 @@ public class InternetExplorerOptions : DriverOptions
private TimeSpan fileUploadDialogTimeout = TimeSpan.MinValue;
private string initialBrowserUrl = string.Empty;
private string browserCommandLineArguments = string.Empty;
- private InternetExplorerElementScrollBehavior elementScrollBehavior = InternetExplorerElementScrollBehavior.Top;
+ private InternetExplorerElementScrollBehavior elementScrollBehavior = InternetExplorerElementScrollBehavior.Default;
private Dictionary<string, object> additionalCapabilities = new Dictionary<string, object>();
private Dictionary<string, object> additionalInternetExplorerOptions = new Dictionary<string, object>();
@@ -432,10 +437,17 @@ public override ICapabilities ToCapabilities()
internetExplorerOptionsDictionary[InitialBrowserUrlCapability] = this.initialBrowserUrl;
}
+ if (this.elementScrollBehavior != InternetExplorerElementScrollBehavior.Default)
+ {
if (this.elementScrollBehavior == InternetExplorerElementScrollBehavior.Bottom)
{
internetExplorerOptionsDictionary[ElementScrollBehaviorCapability] = 1;
}
+ else
+ {
+ internetExplorerOptionsDictionary[ElementScrollBehaviorCapability] = 0;
+ }
+ }
if (this.browserAttachTimeout != TimeSpan.MinValue)
{
