随笔分类 -  selenium

摘要:Assert:失败时,该测试将终止 Verify:失败时,该测试继续执行,并将错误日志记录在日显示屏 Waitfor:等待某些条件变为真,一般使用在AJAX应用程序的测试 断言常用的有,具体见如下:assertLocation:判断当前是在正确的页面assertTitle:检查当前页面的title是 阅读全文
posted @ 2016-11-08 16:35 七月的尾巴_葵花 阅读(7170) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ 我们多添加一些测试场景,比如:删除邮件,查找邮件,发送邮件等等 """ import unittest import os import sys from selenium import webdriver cur_dir = os.getcwd() sys.path.append(cur_di... 阅读全文
posted @ 2016-05-20 16:18 七月的尾巴_葵花 阅读(228) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @desc: delete mail 我们多添加一些测试场景,比如:删除邮件,查找邮件,发送邮件等等 """ import unittest import os import sys from selenium import webdriver cur_dir = os.getcw... 阅读全文
posted @ 2016-05-20 01:35 七月的尾巴_葵花 阅读(260) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @desc: 定制浏览器 """ import unittest import os import time from selenium import webdriver class TestConfigFirefox(unittest.TestCase): def se... 阅读全文
posted @ 2016-05-20 01:34 七月的尾巴_葵花 阅读(256) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @desc: 测试126邮箱的登陆功能 1.使用公共方法public.login 2.将测试数据放在xml文件中,使用数据驱动(/test_data/login.xml) 3.这里使用xml.dom.minidom读取xml数据 """ import unittest import x... 阅读全文
posted @ 2016-05-20 00:13 七月的尾巴_葵花 阅读(385) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @desc: 将登陆动作封装成function """ import unittest import sys import os from selenium import webdriver from selenium.webdriver.common.keys import Keys... 阅读全文
posted @ 2016-05-20 00:09 七月的尾巴_葵花 阅读(267) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @desc: 登陆126邮箱 """ from selenium import webdriver import unittest class TestLogin(unittest.TestCase): def setUp(self): self.drive... 阅读全文
posted @ 2016-05-19 20:37 七月的尾巴_葵花 阅读(419) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @desc: 使用unittest组织用例 """ from selenium import webdriver import unittest import time class TestSearch(unittest.TestCase): def setUp(self)... 阅读全文
posted @ 2016-05-19 20:35 七月的尾巴_葵花 阅读(225) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """ @desc:学习unittest的用法 注意setUp/setUpClass,tearDown/tearDownClass的区别 ① setUp():每个测试函数运行前运行 ② tearDown():每个测试函数运行完后执行 ③ setUpClass():必须使用@classmethod 装饰器,... 阅读全文
posted @ 2016-05-19 10:10 七月的尾巴_葵花 阅读(367) 评论(0) 推荐(0) 编辑
摘要:1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 """ 4 @desc: 操作浏览器 5 6 """ 7 from selenium import webdriver 8 import time 9 import logging 10 11 logging.basicConfig(level=logging.... 阅读全文
posted @ 2016-05-18 18:55 七月的尾巴_葵花 阅读(349) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- """@desc: 讲讲web项目中常用的方法属性 webdriver 提供了八种元素定位方法: id、name、class name、tag name、link text、partial link text、xpath、css selector 在 Python 语言中对应的定位方法如下: ... 阅读全文
posted @ 2016-05-18 16:07 七月的尾巴_葵花 阅读(1264) 评论(0) 推荐(0) 编辑