selenium 事件介绍

鼠标事件

from selenium import webdriver

driver = webdriver.Ie()

driver.get("http://www.baidu.com")

from selenium.webdriver.common.action_chains import ActionChains

ele = driver.find.element_by_link_text(‘百度’)

ActionChains(driver).move_to_element(ele).perfrom()  ###用于生成模拟用户行为

sub_ele = driver.find_element_by_link_text('软件测试')

sub_ele.click()

键盘事件

对话框和多窗口管理

d.current_window_handle:用来显示当前句柄

d.window_handles:  列出所有句柄

d.switch_to_window(d.window_handles[1]):切换句柄 

等待方法

处理Alter对象

测试用例模型

原文地址:https://www.cnblogs.com/huangguabushihaogua/p/9535320.html