Python自动化中的鼠标事件 随笔

1)form selenium.webdriver.common.action_chains import ActionChains  导入该模块

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

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).perfrom() 模拟鼠标滑动并停止在该元素上显示下拉框

Ele2 =b.find_element_by_link_text(‘软件测试’) 定位下拉框里面的元素

Ele2.click() 点击跳转

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄