Python自動化中的鼠標事件


1)from selenium.webdriver.common.action_chains import ActionChains  導入該模塊

2)ActionChains(driver) :用於生成模擬用戶行為

3)Perfrom() :執行儲存行為

form selenium.webdriver.common.action_chains import ActionChains 導入模塊

Ele = b.find_element_by_list_text(‘xxx’) 定位到該元素

ActionChains(driver).move_to_element(ele).perform() 模擬鼠標滑動並停止在該元素上顯示下拉框

Ele2 =b.find_element_by_link_text(‘軟件測試’) 定位下拉框里面的元素

Ele2.click() 點擊跳轉


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM