html 自动化测试,HTMLTestRunner 自动化测试报告
# -*- coding:utf-8 -*-import HTMLTestRunnerimport unittestfrom selenium import webdriverclass ResultDemo(unittest.TestCase):def setUp(self):self.driver = webdriver.Firefox()self.url = 'http://www.51te
# -*- coding:utf-8 -*-
import HTMLTestRunner
import unittest
from selenium import webdriver
class ResultDemo(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.url = 'http://www.51testing.com'
def test_login(self):
driver = self.driver
driver.get(self.url)
driver.find_element_by_id('username').clear()
driver.find_element_by_id('username').send_keys('xxxxxx')
driver.find_element_by_id('userpass').clear()
driver.find_element_by_id('userpass').send_keys('xxxxxx')
driver.find_element_by_id('dologin').click()
driver.find_element_by_id('xspace-seccode').clear()
input_seccode = raw_input('请输入验证码,并按 Enter 键:')
driver.find_element_by_id('xspace-seccode').send_keys(input_seccode)
driver.find_element_by_id('securitysubmit').click()
def tearDown(self):
self.driver.quit()
#pass
if __name__ == "__main__":
testsuite = unittest.TestSuite()
#添加测试用例到测试集中
testsuite.addTest(ResultDemo("test_login"))
#生成测试报告文件
file_name = "D:/result.html"
fp = file(file_name, 'wb')
renner = HTMLTestRunner.HTMLTestRunner(stream=fp, title='测试结果', description='测试报告')
renner.run(testsuite)

HTMLTESTRunner自动化测试报告增加截图功能
我们都知道HTMLTESTRunner自动化测试报告,是Unittest单元测试框架报告,那么在做ui测试的时候就有点不适用了. 我们需要出错截图功能. 以下是我改的,增加了截图功能,先展示界面,再展 ...
Python2 HTMLTestRunner自动化测试报告美化
python2 的测试报告美化,需要的同学直接用 #coding=utf-8 """ A TestRunner for use with the Python unit ...
Python3 HTMLTestRunner自动化测试报告美化
# FileName : MyHTMLTestRunner.py # Author : wangyinghao # DateTime : 2019/1/9 21:04 # SoftWare : PyC ...
Python+Selenium----使用HTMLTestRunner.py生成自动化测试报告2(使用PyCharm )
1.说明 在我前一篇文件(Python+Selenium----使用HTMLTestRunner.py生成自动化测试报告1(使用IDLE ))中简单的写明了,如何生产测试报告,但是使用IDLE很麻烦, ...
Python+Selenium----使用HTMLTestRunner.py生成自动化测试报告1(使用IDLE)
1.说明 自动化测试报告是一个很重要的测试数据,网上看了一下,使用HTMLTestRunner.py生成自动化测试报告使用的比较多,但是呢,小白刚刚入手,不太懂,看了很多博客,终于生成了一个测试报告, ...
Python&;Selenium借助HTMLTestRunner生成自动化测试报告
一.摘要 本篇博文介绍Python和Selenium进行自动化测试时,借助著名的HTMLTestRunner生成自动化测试报告 HTMLTestRunner.py百度很多,版本也很多,自行搜索下载放到 ...
Python&;Selenium借助html-testRunner生成自动化测试报告
一.摘要 本博文将介绍Python和Selenium进行自动化测试时,借助html-testRunner 生成自动化测试报告 安装命令:pip install html-testRunner 二.测试 ...
Python+Selenium框架 ---自动化测试报告的生成
本文来介绍如何生成自动化测试报告,前面文章尾部提到了利用HTMLTestRunner.py来生成自动化测试报告.关于HTMLTestRunner不过多介绍,只需要知道是一个能生成一个HTML格式的网页 ...
unittest接口自动化测试报告
unittest接口自动化测试报告 展示: 代码: __author__ = "Wai Yip Tung, Findyou" __version__ = "0.8.2.1 ...
随机推荐
jquery.zclip轻量级复制失效问题
工作原理 利用一个透明的 Flash ,让其漂浮在按钮之上,这样其实点击的不是按钮而是 Flash ,也就可以使用 Flash 的复制功能了
更多推荐




所有评论(0)