随笔分类 -  selenium

摘要:if __name__=='__main__': unittest.main(verbosity=2) suite=unittest.TestSuite() #定义一个测试测试套件#添加部分测试用例, 为什么会报错, #suite.addTest(Test_calculator("test_add" 阅读全文
posted @ 2020-04-24 00:55 晚饭不食 阅读(165) 评论(0) 推荐(0)
摘要:最基本unnittest框架 import unittestimport HtmlTestRunnerdef add(x,y): return x+ydef sbtract(x,y): return x-ydef multiplay(x,y): return x*ydef divide(x,y): 阅读全文
posted @ 2020-04-23 23:53 晚饭不食 阅读(185) 评论(0) 推荐(0)
摘要:获得当前窗口句柄:b.current_window_handle 获取所有窗口的句柄:b.window_handles 切换到相应的窗口:switch_to_window() # b = webdriver.Chrome()# b.implicitly_wait(10)# b.maximize_wi 阅读全文
posted @ 2019-07-17 23:22 晚饭不食 阅读(501) 评论(0) 推荐(0)
摘要:切换iframe表单:b.switch_to_frame(iframe) 返回上级表单:b.switch_to_default_content() 切换表单前找到表单:iframe_ele = b.find_element_by_id('表单元素') select_ele = b.find_elem 阅读全文
posted @ 2019-07-12 00:26 晚饭不食 阅读(320) 评论(0) 推荐(0)