Book Image

Learning Selenium Testing Tools - Third Edition

Book Image

Learning Selenium Testing Tools - Third Edition

Overview of this book

Table of Contents (22 chapters)
Learning Selenium Testing Tools Third Edition
About the Author
About the Reviewers

What is Advanced User Interactions API?

The Advanced User Interactions API is a new, more comprehensive API for describing actions a user can perform on a web page. Normally, we need to find elements and then send actions through them. If we need to perform complex tasks such as holding down Ctrl and clicking, then this may not work.

The Advanced User Interactions allows us to build these complex interactions with elements in a really nice API. The API relies on two key interfaces for the interactions to work—keyboard and mouse.


The keyboard interface allows keys to be pressed, held down, and released. It also allows for normal typing.

The methods available are:

  • void sendKeys(CharSequence... keysToSend): This is similar to the existing sendKeys(...) method.

  • void pressKey(Keys keyToPress): This sends a key press only, without releasing it. This should only be implemented for modifier keys (Control, Alt, and Shift).

  • void releaseKey(Keys keyToRelease): This releases a modifier key.