Selenium _ mouse and keyboard event instances, selenium instances
[ActionChains and input events]
1: from selenium. webdriver. common. action_chains import ActionChains
2: ActionChains (driver): used to generate simulated user behavior
3: perform (): executes storage behavior
Mouse event]
Expression |
Description |
Context_click |
Right-click event |
Double_click |
Double-click event |
Drag_and_drop |
Drag |
Move_to_element () |
Hover your mouse over an element. |
Click_and_hold |
Click the left mouse button on an element. |
[Keyboard event: send_keys ()]
From selenium. webdriver. common. keys import Keys
Expression |
Description |
Send_kyes (Kyes. BACK_SPACE) |
Return key |
Double_click |
Double-click event |
Send_kyes (Kyes. CONTRL, 'A ') |
Select All |
Send_kyes (Kyes. CONTRL, 'V ') |
Paste |
Send_kyes (Kyes. CONTRL, 'C ') |
Copy |
Send_kyes (Kyes. CONTRL, 'x ') |
Cut |
Send_kyes (Kyes. ENTER) |
Enter |