Actions are commands that manipulate the state of the application. Upon execution, if an action fails the execution of the current test is stopped. For Example, "click a link" and "select an option".
The following table lists the Selenium action commands that are used very frequently, however the list is note exhaustive.
|Sr.No.||Command/Syntax & Description|
Clicks on a link, button, checkbox or radio button
Clicks on an element with the help of locator and co-ordinates
Simulates the user clicking the "close" button in the title bar of a popup window or tab.
Simulates opening the context menu of the specified element from a specified location
Double clicks on a webelement based on the specified element.
Drags an element and then drops it based on specified distance.
Drags an element and drops it on another element.
Prints the specified message on console which is used for debugging.
Explicitly simulate an event, to trigger the corresponding "onevent" handler
Move the focus to the specified element
Changes the background Color of the specified element to yellow Briefly which is useful for debugging purposes.
Simulates a user pressing the left mouse button on the specified element.
Simulates a user pressing the left mouse button at the specified location on the specified element.
Simulates the event that occurs when the user releases the mouse button
Simulates the event that occurs when the user releases the mouse button at the specified location.
Opens an URL in the specified browser and it accepts both relative and absolute URLs.
Opens a popup window. After opening the window, user need to activate it using the selectWindow command.
Waits for the specified amount of time (in milliseconds)
Simulates the user clicking the "Refresh" button on their browser.
Select an option from a drop-down using an option locator.
Selects a popup window using a window locator; once a popup window has been selected, all focus shifts to that window.
The name of a variable in which the result is to be stored and expression is the value to store
Sets the value of an input field, similar to user typing action.
Simulates keystroke events on the specified element, as though you typed the value key-by-key.
Waits for a new page to load.
Waits for a popup window to appear and load.
Gives focus to the currently selected window
Resize currently selected window to take up the entire screen