Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Selenium keyboard and mouse events

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Simulate a mouse event

1.from selenium.webdriver.common.action_chains import ActionChains

2:ActionChains (driver): used to generate simulated user behavior

3:perform (): performs storage behavior

The expression shows that context_click right-click event double_click double-click event drag_and_drop drag move_to_element () mouse over an element click_and_hold presses the left mouse button on an element

Example: ActionChains (driver). Move_to_element (ele). Perform ()

Simulated keyboard event

Send_keys ()

From selenium.webdriver.common.keys import Keys

The expression states that send_kyes (Kyes.BACK_SPACE) backspace key send_kyes (Kyes.CONTRL,'a') all select send_kyes (Kyes.CONTRL,'v') paste send_kyes (Kyes.CONTRL,'c') copy send_kyes (Kyes.CONTRL,'x') cut send_kyes (Kyes.ENTER) enter

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report