Actions
Perform a chain or multiple chains of keyboard and pointer (touch, mouse, stylus) actions
Example Usage
1 element = driver.find_element_by_accessibility_id("elId") 2 actions = ActionChains(driver) 3 actions.move_to_element(element) 4 actions.click(hidden_submenu) 5 actions.perform()
Description
- input source: Represents an input device (pointer or key) that a series of actions are dispatched to. The input source has a unique ID.
- action: An action that is dispatched to an input source. For a keyboard source, this can be 'keyDown' or 'keyUp'. For a pointer event this can be 'pointerMove', 'pointerDown', or 'pointerUp'. 'pause' events can also be sent to the device.
The Actions API takes a list of input sources and executes each 'tick'. A 'tick' is a slice of an action chain, so if you have two input sources, the first 'tick' is the 0-indexed action, the second 'tick' is the 1-indexed action, etc.... All of the actions per tick are executed concurrently.
传送门:https://blog.csdn.net/weixin_45576146/article/details/116052267