/// <summary>Double-clicks an element.</summary> /// <param name="webelement">The element to double-click. If None, clicks on current mouse position.</param> /// <returns></returns> public Actions doubleClick(WebElement webelement = null) { if (webelement == null) _actions.DoubleClick(); else _actions.DoubleClick(webelement._webElement); return this; }
/// <summary>Performs a context-click (right click) on an element.</summary> /// <param name="webelement"> The element to context-click. If None, clicks on current mouse position.</param> /// <returns></returns> public Actions contextClick(WebElement webelement = null) { if (webelement == null) _actions.ContextClick(); else _actions.ContextClick(webelement._webElement); return this; }
/// <summary>Holds down the left mouse button on an element.</summary> /// <param name="webelement">The element to mouse down. If None, clicks on current mouse position.</param> /// <returns></returns> public Actions clickAndHold(WebElement webelement = null) { if (webelement == null) _actions.ClickAndHold(); else _actions.ClickAndHold(webelement._webElement); return this; }
/// <summary>Drag and drop the element to another element</summary> /// <param name="target">Target WebElement</param> public void dragAndDropToWebElement(WebElement target) { new OpenQA.Selenium.Interactions.Actions(_webDriver).DragAndDrop(_webElement, target._webElement).Perform(); }
public void Add(WebElement webelement) { base.Add(webelement); }
/// <summary>Releases a modifier key.</summary> /// <param name="key">The modifier key to send. Values are defined in Keys class.</param> /// <param name="webelement">The element to send keys. If None, sends a key to current focused element.</param> /// <returns></returns> public Actions keyUp(string key, WebElement webelement = null) { if (webelement == null) _actions.KeyUp(key); else _actions.KeyUp(webelement._webElement, key); return this; }
/// <summary>Holds down the left mouse button on the source element, then moves to the target element and releases the mouse button.</summary> /// <param name="webelement_source">The element to mouse down.</param> /// <param name="offset_x">X offset to move to.</param> /// <param name="offset_y">Y offset to move to.</param> /// <returns></returns> public Actions dragAndDropByOffset(WebElement webelement_source, int offset_x, int offset_y) { _actions.DragAndDropToOffset(webelement_source._webElement, offset_x, offset_y); return this; }
/// <summary>Holds down the left mouse button on the source element, then moves to the target element and releases the mouse button.</summary> /// <param name="webelement_source">The element to mouse down.</param> /// <param name="webelement_target">The element to mouse up.</param> /// <returns></returns> public Actions dragAndDrop(WebElement webelement_source, WebElement webelement_target) { _actions.DragAndDrop(webelement_source._webElement, webelement_target._webElement); return this; }
/// <summary>Sends keys to an element.</summary> /// <param name="keys"></param> /// <param name="webelement">Element to send keys. If None, send keys to the current mouse position.</param> /// <returns></returns> public Actions sendKeys(string keys, WebElement webelement = null) { if (webelement == null) _actions.SendKeys(keys); else _actions.SendKeys(webelement._webElement, keys); return this; }
/// <summary>Moving the mouse to the middle of an element.</summary> /// <param name="webelement">The element to move to.</param> /// <returns></returns> public Actions moveToElement(WebElement webelement) { _actions.MoveToElement(webelement._webElement); return this; }