© Courtney Zhan, Edited by Zhimin Zhan 2024
Z. Zhan (ed.)Selenium WebDriver Recipes in C#https://doi.org/10.1007/979-8-8688-0023-8_17

17. Advanced User Interactions

Courtney Zhan1  
(1)
Fitzgibbon, QLD, Australia
 

The Advanced User Interactions API in Selenium WebDriver provides a way to set up and perform complex user interactions, specifically those that group a series of keyboard and mouse operations and send them to the browser.

Mouse interactions:
  • Click()

  • ClickAndHold()

  • ContextClick()

  • DoubleClick()

  • DragAndDrop()

  • DragAndDropToOffset()

  • MoveByOffset()

  • MoveToElement()

  • Release()

Keyboard interactions:
  • KeyDown()

  • KeyUp()

  • SendKeys()

Usage:
new Actions(driver). + one or more above operations + .Perform();
Actions namespace:
using OpenQA.Selenium.Interactions;

Check out the ...

Get Selenium WebDriver Recipes in C#: Practical Testing Solutions for Selenium WebDriver now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.