Selenium _ mouse and keyboard event instances, selenium instances

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.