public Frame(BrowserElement frameElement) : base(frameElement.Description) { _frameElement = frameElement; var browser = _frameElement.DOMRoot.Browser; _webDriver = browser.GetWebDriver(); }
/// <summary> /// Initializes a new instance of the <see cref="Frame"/> class representing the frame element specified /// </summary> /// <param name="frameElement">The BrowserElement of the frame element</param> public Frame(BrowserElement frameElement) : base(frameElement.Description) { _frameElement = frameElement; var browser = _frameElement.DOMRoot.Browser; _webDriver = browser.GetWebDriver(); }
public void DragAndDrop(BrowserElement target) { Logger.WriteLine("Drag element '{0}' to '{1}'", Description, target.Description); var targetWebElement = target.WebElement; var action = CreateActionsSequence(); var dragAndDrop = action.MoveToElement(WebElement).DragAndDrop(WebElement, targetWebElement).Build(); dragAndDrop.Perform(); }
/// <summary> /// Drags the current element onto the target element /// </summary> /// <param name="target">The target element to drop the current element onto</param> /// <exception cref="ArgumentNullException"><paramref name="target"/> is null</exception> public void DragAndDrop(BrowserElement target) { if (target == null) { throw new ArgumentNullException("target"); } Logger.WriteLine("Drag element '{0}' to '{1}'", Description, target.Description); var targetWebElement = target.WebElement; var action = CreateActionsSequence(); var dragAndDrop = action.MoveToElement(WebElement).DragAndDrop(WebElement, targetWebElement).Build(); dragAndDrop.Perform(); }
/// <summary> /// Copy constructor /// </summary> /// <param name="otherElement">Other object from which to copy the properties into the new object</param> protected BrowserElement(BrowserElement otherElement) : this(otherElement, otherElement.Description) { }
/// <summary> /// Constructs a new instance of <see cref="BrowserElement"/> by copying its properties, except of its description from another element /// </summary> /// <param name="otherElement">The existing element to copy its properties from</param> /// <param name="description">The new description to use for the new object</param> /// <exception cref="ArgumentNullException"><paramref name="otherElement"/> is null</exception> protected BrowserElement(BrowserElement otherElement, string description) : this(SafeGetDOMRoot(otherElement, "otherElement"), () => otherElement.WebElement, description) { }
/// <summary> /// Drags the current element onto the target element /// </summary> /// <param name="target">The target element to drop the current element onto</param> /// <exception cref="ArgumentNullException"><paramref name="target"/> is null</exception> public void DragAndDrop(BrowserElement target) { if (target == null) throw new ArgumentNullException("target"); Logger.WriteLine("Drag element '{0}' to '{1}'", Description, target.Description); var targetWebElement = target.WebElement; var action = CreateActionsSequence(); var dragAndDrop = action.MoveToElement(WebElement).DragAndDrop(WebElement, targetWebElement).Build(); dragAndDrop.Perform(); }