Selenium class of ActionChains

ActionChains type commonly used in the simulation of the behavior of the mouse, such as click, double click, drag and other acts.

Some commonly used method of operating a simulated mouse has:

       click (on_element = None) --- click

       double_click(on_element=None)    ---  双击       

       context_click (on_element = None) --- Right-click       

       click_and_hold (on_element = None) --- Click and hold the mouse

       drag_and_drop(source,target)   ---  拖拽

       drag_and_drop_by_offset (source, xoffset, yoffset) --- The target of the drag to the specified location

       key_down (value, element = None) --- pressing a key on a keyboard

       key_up (value, element = None) --- a key release

       move_by_offset (xoffset, yoffset) --- mouse to move from the current location to a coordinate

       move_to_element (to_element) --- Move the mouse to an element

       move_to_element_with_offset (to_element, xoffset, yoffset) --- moved to a position away from an element (left corner) how much distance

       perform () performs all actions in the chain ---

       release (on_element = None) --- Release the left mouse button on an element position

Let's look at some examples:

       Click, double click, right-click ----- examples 

 

       Examples of dragging ------

 

       Examples keys ---

 

       鼠标移动  -----  实例

Guess you like

Origin www.cnblogs.com/peipei-Study/p/11975794.html