seleniumbase / SeleniumBase

📊 Blazing fast Python framework for web crawling, scraping, testing, and reporting. Supports pytest. Stealth abilities: UC Mode and CDP Mode.
https://seleniumbase.io
MIT License
5.43k stars 982 forks source link

Long Press or Long Click for the element using cdp method! #3285

Closed mynguyen95dn closed 6 hours ago

mynguyen95dn commented 6 hours ago

Hi , I tried to use cdp mode to click and hold button by selector. Any idea for that case?

Thank you!

mdmintz commented 6 hours ago

Press-and-hold in CDP Mode is just sb.cdp.gui_drag_and_drop(drag_selector, drop_selector, timeframe), where the drag_selector is the same as the drop_selector.

https://github.com/seleniumbase/SeleniumBase/blob/d8d02cd4740e700ef6ea3b133bbdc9830e728cf4/seleniumbase/core/sb_cdp.py#L1304