C# Class Selenium.Actions

Inheritance: ComInterfaces._Actions
Show file Open project: florentbr/SeleniumBasic Class Usage Examples

Public Methods

Method Description
Click ( WebElement element = null ) : Actions

Clicks an element.

ClickAndHold ( WebElement element = null ) : Actions

Holds down the left mouse button on an element.

ClickContext ( WebElement element = null ) : Actions

Performs a context-click (right click) on an element.

ClickDouble ( WebElement element = null ) : Actions

Double-clicks an element.

DragAndDrop ( WebElement elementSource, WebElement elementTarget ) : Actions

Holds down the left mouse button on the source element, then moves to the target element and releases the mouse button.

DragAndDropByOffset ( WebElement element, int offset_x, int offset_y ) : Actions

Holds down the left mouse button on the source element, then moves to the target element and releases the mouse button.

KeyDown ( string modifierKey, WebElement element = null ) : Actions

Sends a key press only, without releasing it. Should only be used with modifier keys (Control, Alt and Shift).

KeyUp ( string modifierKey ) : Actions

Releases a modifier key.

MoveByOffset ( int offset_x, int offset_y ) : Actions

Moving the mouse to an offset from current mouse position.

MoveToElement ( WebElement element ) : Actions

Moving the mouse to the middle of an element.

Perform ( ) : void

Performs all stored Actions.

Release ( [ element = null ) : Actions

Releasing a held mouse button.

SendKeys ( string keys, WebElement element = null ) : Actions

Sends keys to an element.

Wait ( int timems ) : Actions

Waits the given time in millisecond.

Private Methods

Method Description
Actions ( RemoteSession session ) : Selenium.Core
act_click ( WebElement element ) : void
act_click_context ( WebElement element ) : void
act_click_double ( WebElement element ) : void
act_drag_drop ( WebElement elementSource, WebElement elementTarget ) : void
act_drag_drop_offset ( WebElement element, int offset_x, int offset_y ) : void
act_key_down ( string modifierKey, WebElement element ) : void
act_mouse_click ( ) : void
act_mouse_click_context ( ) : void
act_mouse_click_double ( ) : void
act_mouse_mouve ( WebElement element ) : void
act_mouse_mouve ( int offsetX, int offsetY ) : void
act_mouse_press ( WebElement element ) : void
act_mouse_release ( WebElement element ) : void
act_send_keys ( string keys ) : void
act_send_keys ( string keys, WebElement element ) : void
act_send_modifier_key ( string modifierKey ) : void

Method Details

Click() public method

Clicks an element.
public Click ( WebElement element = null ) : Actions
element WebElement The element to click. If None, clicks on current mouse position.
return Actions

ClickAndHold() public method

Holds down the left mouse button on an element.
public ClickAndHold ( WebElement element = null ) : Actions
element WebElement The element to mouse down. If None, clicks on current mouse position.
return Actions

ClickContext() public method

Performs a context-click (right click) on an element.
public ClickContext ( WebElement element = null ) : Actions
element WebElement The element to context-click. If None, clicks on current mouse position.
return Actions

ClickDouble() public method

Double-clicks an element.
public ClickDouble ( WebElement element = null ) : Actions
element WebElement The element to double-click. If None, clicks on current mouse position.
return Actions

DragAndDrop() public method

Holds down the left mouse button on the source element, then moves to the target element and releases the mouse button.
public DragAndDrop ( WebElement elementSource, WebElement elementTarget ) : Actions
elementSource WebElement The element to mouse down.
elementTarget WebElement The element to mouse up.
return Actions

DragAndDropByOffset() public method

Holds down the left mouse button on the source element, then moves to the target element and releases the mouse button.
public DragAndDropByOffset ( WebElement element, int offset_x, int offset_y ) : Actions
element WebElement The element to mouse down.
offset_x int X offset to move to.
offset_y int Y offset to move to.
return Actions

KeyDown() public method

Sends a key press only, without releasing it. Should only be used with modifier keys (Control, Alt and Shift).
public KeyDown ( string modifierKey, WebElement element = null ) : Actions
modifierKey string The modifier key to Send. Values are defined in Keys class.
element WebElement The element to Send keys. If None, sends a key to current focused element.
return Actions

KeyUp() public method

Releases a modifier key.
public KeyUp ( string modifierKey ) : Actions
modifierKey string The modifier key to Send. Values are defined in Keys class.
return Actions

MoveByOffset() public method

Moving the mouse to an offset from current mouse position.
public MoveByOffset ( int offset_x, int offset_y ) : Actions
offset_x int X offset to move to.
offset_y int Y offset to move to.
return Actions

MoveToElement() public method

Moving the mouse to the middle of an element.
public MoveToElement ( WebElement element ) : Actions
element WebElement The element to move to.
return Actions

Perform() public method

Performs all stored Actions.
public Perform ( ) : void
return void

Release() public method

Releasing a held mouse button.
public Release ( [ element = null ) : Actions
element [
return Actions

SendKeys() public method

Sends keys to an element.
public SendKeys ( string keys, WebElement element = null ) : Actions
keys string Keys to send
element WebElement Element to Send keys. If None, Send keys to the current mouse position.
return Actions

Wait() public method

Waits the given time in millisecond.
public Wait ( int timems ) : Actions
timems int Time to wait in millisecond.
return Actions