Table of Contents

Class TouchActions

Namespace
OpenQA.Selenium.Interactions
Assembly
WebDriver.dll

Provides a mechanism for building advanced interactions with the browser.

public class TouchActions : Actions
Inheritance
TouchActions
Inherited Members

Constructors

TouchActions(IWebDriver)

Initializes a new instance of the TouchActions class.

public TouchActions(IWebDriver driver)

Parameters

driver IWebDriver

The IWebDriver object on which the actions built will be performed.

Methods

DoubleTap(IWebElement)

Double-taps the touch screen on the specified element.

public TouchActions DoubleTap(IWebElement onElement)

Parameters

onElement IWebElement

The element on which to double-tap.

Returns

TouchActions

A self-reference to this TouchActions.

Down(int, int)

Presses down at the specified location on the screen.

public TouchActions Down(int locationX, int locationY)

Parameters

locationX int

The x coordinate relative to the view port.

locationY int

The y coordinate relative to the view port.

Returns

TouchActions

A self-reference to this TouchActions.

Flick(IWebElement, int, int, int)

Flicks the current view starting at a specific location.

public TouchActions Flick(IWebElement onElement, int offsetX, int offsetY, int speed)

Parameters

onElement IWebElement

The element at which to start the flick.

offsetX int

The x offset relative to the viewport.

offsetY int

The y offset relative to the viewport.

speed int

The speed in pixels per second.

Returns

TouchActions

A self-reference to this TouchActions.

Flick(int, int)

Flicks the current view.

public TouchActions Flick(int speedX, int speedY)

Parameters

speedX int

The horizontal speed in pixels per second.

speedY int

The vertical speed in pixels per second.

Returns

TouchActions

A self-reference to this TouchActions.

LongPress(IWebElement)

Presses and holds on the touch screen on the specified element.

public TouchActions LongPress(IWebElement onElement)

Parameters

onElement IWebElement

The element on which to press and hold

Returns

TouchActions

A self-reference to this TouchActions.

Move(int, int)

Moves to the specified location on the screen.

public TouchActions Move(int locationX, int locationY)

Parameters

locationX int

The x coordinate relative to the view port.

locationY int

The y coordinate relative to the view port.

Returns

TouchActions

A self-reference to this TouchActions.

Scroll(IWebElement, int, int)

Scrolls the touch screen beginning at the specified element.

public TouchActions Scroll(IWebElement onElement, int offsetX, int offsetY)

Parameters

onElement IWebElement

The element on which to begin scrolling.

offsetX int

The x coordinate relative to the view port.

offsetY int

The y coordinate relative to the view port.

Returns

TouchActions

A self-reference to this TouchActions.

Scroll(int, int)

Scrolls the touch screen to the specified offset.

public TouchActions Scroll(int offsetX, int offsetY)

Parameters

offsetX int

The horizontal offset relative to the view port.

offsetY int

The vertical offset relative to the view port.

Returns

TouchActions

A self-reference to this TouchActions.

SingleTap(IWebElement)

Taps the touch screen on the specified element.

public TouchActions SingleTap(IWebElement onElement)

Parameters

onElement IWebElement

The element on which to tap.

Returns

TouchActions

A self-reference to this TouchActions.

Up(int, int)

Releases a press at the specified location on the screen.

public TouchActions Up(int locationX, int locationY)

Parameters

locationX int

The x coordinate relative to the view port.

locationY int

The y coordinate relative to the view port.

Returns

TouchActions

A self-reference to this TouchActions.