selenium+python自动化测试基础知识:
1. 两个窗口切换:
for handle in handles:
if handle != handles:
driver.switch_to_window(handle)
2. 三种等待方式:
sleep(10) 强制等待
driver.implicitly_wait(10) 隐式等待/智能等待
WebDriverWait(driver, 10, 0.5) 显式等待
3. 八种定位方式:
find_element_by_id()
find_element_by_name()
find_element_by_class_name()
find_element_by_tag()
find_element_by_link_text()
find_element_by_partial_text()
find_element_by_css_selector()
find_element_by_xpath()
原文:https://www.cnblogs.com/weiyl123/p/11565295.html