diff --git a/dotnet/src/webdriver/Interactions/ActionBuilder.cs b/dotnet/src/webdriver/Interactions/ActionBuilder.cs index 92b2b1e260c25..b9f4f92f94feb 100644 --- a/dotnet/src/webdriver/Interactions/ActionBuilder.cs +++ b/dotnet/src/webdriver/Interactions/ActionBuilder.cs @@ -27,7 +27,7 @@ namespace OpenQA.Selenium.Interactions /// Provides methods that allow the creation of action sequences to enable /// advanced user interactions. /// - internal class ActionBuilder + public class ActionBuilder { private Dictionary sequences = new Dictionary(); diff --git a/dotnet/src/webdriver/Interactions/ActionSequence.cs b/dotnet/src/webdriver/Interactions/ActionSequence.cs index dafdfa00b776b..f94bcca754730 100644 --- a/dotnet/src/webdriver/Interactions/ActionSequence.cs +++ b/dotnet/src/webdriver/Interactions/ActionSequence.cs @@ -27,7 +27,7 @@ namespace OpenQA.Selenium.Interactions /// /// Represents a sequence of actions to be performed in the target browser. /// - internal class ActionSequence + public class ActionSequence { private List interactions = new List(); private InputDevice device; diff --git a/dotnet/src/webdriver/Interactions/InputDevice.cs b/dotnet/src/webdriver/Interactions/InputDevice.cs index f53842787957a..7b4efa45dfff8 100644 --- a/dotnet/src/webdriver/Interactions/InputDevice.cs +++ b/dotnet/src/webdriver/Interactions/InputDevice.cs @@ -25,7 +25,7 @@ namespace OpenQA.Selenium.Interactions /// /// Base class for all input devices for actions. /// - internal abstract class InputDevice + public abstract class InputDevice { private string deviceName; diff --git a/dotnet/src/webdriver/Interactions/InputDeviceKind.cs b/dotnet/src/webdriver/Interactions/InputDeviceKind.cs index 3ca3fa68c17b5..0386ff8bdc224 100644 --- a/dotnet/src/webdriver/Interactions/InputDeviceKind.cs +++ b/dotnet/src/webdriver/Interactions/InputDeviceKind.cs @@ -21,7 +21,7 @@ namespace OpenQA.Selenium.Interactions /// /// Enumerated values for the kinds of devices available. /// - internal enum InputDeviceKind + public enum InputDeviceKind { /// /// Represents the null device. diff --git a/dotnet/src/webdriver/Interactions/Interaction.cs b/dotnet/src/webdriver/Interactions/Interaction.cs index 85b9626cd8f03..2ec2c72ab56de 100644 --- a/dotnet/src/webdriver/Interactions/Interaction.cs +++ b/dotnet/src/webdriver/Interactions/Interaction.cs @@ -26,7 +26,7 @@ namespace OpenQA.Selenium.Interactions /// /// Represents a single interaction for a given input device. /// - internal abstract class Interaction + public abstract class Interaction { private InputDevice sourceDevice; diff --git a/dotnet/src/webdriver/Internal/IActionExecutor.cs b/dotnet/src/webdriver/Internal/IActionExecutor.cs index 922a5c05aaa32..49a98767734cd 100644 --- a/dotnet/src/webdriver/Internal/IActionExecutor.cs +++ b/dotnet/src/webdriver/Internal/IActionExecutor.cs @@ -27,7 +27,7 @@ namespace OpenQA.Selenium.Internal /// /// Interface allowing execution of W3C Specification-compliant actions. /// - internal interface IActionExecutor + public interface IActionExecutor { /// /// Gets a value indicating whether this object is a valid action executor. @@ -38,7 +38,7 @@ internal interface IActionExecutor /// Performs the specified list of actions with this action executor. /// /// The list of action sequences to perform. - void PerformActions(List actionSequenceList); + void PerformActions(IList actionSequenceList); /// /// Resets the input state of the action executor. diff --git a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs index 7f980062163dc..64bba89eff32c 100644 --- a/dotnet/src/webdriver/Remote/RemoteWebDriver.cs +++ b/dotnet/src/webdriver/Remote/RemoteWebDriver.cs @@ -68,7 +68,7 @@ public class RemoteWebDriver : IWebDriver, ISearchContext, IJavaScriptExecutor, /// protected static readonly TimeSpan DefaultCommandTimeout = TimeSpan.FromSeconds(60); - private static readonly string DefaultRemoteServerUrl = "http://127.0.0.1:4444/wd/hub"; + private const string DefaultRemoteServerUrl = "http://127.0.0.1:4444/wd/hub"; private ICommandExecutor executor; private ICapabilities capabilities; @@ -85,7 +85,7 @@ public class RemoteWebDriver : IWebDriver, ISearchContext, IJavaScriptExecutor, /// /// An object containing the desired capabilities of the browser. public RemoteWebDriver(DriverOptions options) - : this(options.ToCapabilities()) + : this(ConvertOptionsToCapabilities(options)) { } @@ -104,7 +104,7 @@ public RemoteWebDriver(ICapabilities desiredCapabilities) /// URI containing the address of the WebDriver remote server (e.g. http://127.0.0.1:4444/wd/hub). /// An object containing the desired capabilities of the browser. public RemoteWebDriver(Uri remoteAddress, DriverOptions options) - : this(remoteAddress, options.ToCapabilities()) + : this(remoteAddress, ConvertOptionsToCapabilities(options)) { } @@ -415,7 +415,7 @@ public SessionId SessionId /// /// Gets a value indicating whether this object is a valid action executor. /// - bool IActionExecutor.IsActionExecutor + public bool IsActionExecutor { get { return this.IsSpecificationCompliant; } } @@ -940,8 +940,13 @@ public void Dispose() /// Performs the specified list of actions with this action executor. /// /// The list of action sequences to perform. - void IActionExecutor.PerformActions(List actionSequenceList) + public void PerformActions(IList actionSequenceList) { + if (actionSequenceList == null) + { + throw new ArgumentNullException("actionSequenceList", "List of action sequences must not be null"); + } + if (this.IsSpecificationCompliant) { List objectList = new List(); @@ -959,7 +964,7 @@ void IActionExecutor.PerformActions(List actionSequenceList) /// /// Resets the input state of the action executor. /// - void IActionExecutor.ResetInputState() + public void ResetInputState() { if (this.IsSpecificationCompliant) { @@ -1117,14 +1122,14 @@ protected void StartSession(ICapabilities desiredCapabilities) /// /// Gets the capabilities as a dictionary supporting legacy drivers. /// - /// The dictionary to return. + /// The dictionary to return. /// A Dictionary consisting of the capabilities requested. /// This method is only transitional. Do not rely on it. It will be removed /// once browser driver capability formats stabilize. - protected virtual Dictionary GetLegacyCapabilitiesDictionary(ICapabilities capabilities) + protected virtual Dictionary GetLegacyCapabilitiesDictionary(ICapabilities legacyCapabilities) { Dictionary capabilitiesDictionary = new Dictionary(); - DesiredCapabilities capabilitiesObject = capabilities as DesiredCapabilities; + DesiredCapabilities capabilitiesObject = legacyCapabilities as DesiredCapabilities; foreach (KeyValuePair entry in capabilitiesObject.CapabilitiesDictionary) { capabilitiesDictionary.Add(entry.Key, entry.Value); @@ -1136,14 +1141,14 @@ protected virtual Dictionary GetLegacyCapabilitiesDictionary(ICa /// /// Gets the capabilities as a dictionary. /// - /// The dictionary to return. + /// The dictionary to return. /// A Dictionary consisting of the capabilities requested. /// This method is only transitional. Do not rely on it. It will be removed /// once browser driver capability formats stabilize. - protected virtual Dictionary GetCapabilitiesDictionary(ICapabilities capabilities) + protected virtual Dictionary GetCapabilitiesDictionary(ICapabilities capabilitiesToConvert) { Dictionary capabilitiesDictionary = new Dictionary(); - DesiredCapabilities capabilitiesObject = capabilities as DesiredCapabilities; + DesiredCapabilities capabilitiesObject = capabilitiesToConvert as DesiredCapabilities; foreach (KeyValuePair entry in capabilitiesObject.CapabilitiesDictionary) { if (entry.Key != CapabilityType.Version && entry.Key != CapabilityType.Platform) @@ -1438,6 +1443,16 @@ private static void UnpackAndThrowOnError(Response errorResponse) } } + private static ICapabilities ConvertOptionsToCapabilities(DriverOptions options) + { + if (options == null) + { + throw new ArgumentNullException("options", "Driver options must not be null"); + } + + return options.ToCapabilities(); + } + private object ParseJavaScriptReturnValue(object responseValue) { object returnValue = null;