摘要: 首先, 添加ddt模块: 阅读全文
posted @ 2018-02-28 10:48 此生不换Yang 阅读(456) 评论(0) 推荐(0) 编辑
摘要: 首先, 添加PyMySQL模块: 代码: 阅读全文
posted @ 2018-02-27 20:18 此生不换Yang 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 1、通过示例介绍Selenium-WebDriver 一个简单的入门方法就是这个例子,它在Google上搜索术语“Cheese”,然后将结果页面的标题输出到控制台。java csharp pythonfrom selenium import webdriverfrom selenium.common 阅读全文
posted @ 2018-02-26 23:10 此生不换Yang 阅读(408) 评论(0) 推荐(0) 编辑
摘要: import osimport unittestdirectory = os.getcwd()# 测试用例的目录organize = unittest.defaultTestLoader.discover(directory, pattern='test*.py')"""discover()方法有3 阅读全文
posted @ 2018-02-26 12:31 此生不换Yang 阅读(795) 评论(0) 推荐(0) 编辑
摘要: """A TestRunner for use with the Python unit testing framework. Itgenerates a HTML report to show the result at a glance.The simplest way to use this 阅读全文
posted @ 2018-02-25 21:41 此生不换Yang 阅读(498) 评论(0) 推荐(0) 编辑
摘要: import unittestfrom time import sleepimport osfrom selenium import webdriverimport win32apiimport win32conimport win32clipboard as cutfrom selenium.we 阅读全文
posted @ 2018-02-25 20:10 此生不换Yang 阅读(1665) 评论(0) 推荐(1) 编辑
摘要: 假如你安装的是Python3.6, 那么可以直接用PyCharm或者pip安装pywin32模块: 但是, 由于我安装的是Python3.7, 所以PyCharm或者pip都无法成功安装pywin32模块, 所以只能手动安装了, 打开https://github.com/mhammond/pywin 阅读全文
posted @ 2018-02-25 15:05 此生不换Yang 阅读(46715) 评论(1) 推荐(2) 编辑
摘要: 由于Python3已经不支持HTMLTestRunner了, 无论是PyCharm还是pip都无法安装成功, 所以只能去 http://tungwaiyip.info/software/HTMLTestRunner_0_8_2/HTMLTestRunner.py 手动下载: 在网页空白处点击鼠标右键 阅读全文
posted @ 2018-02-24 23:53 此生不换Yang 阅读(5282) 评论(0) 推荐(0) 编辑
摘要: unittest是Python的单元测试框架, 类似于Java里面的TestNG。 Unittest.py: 阅读全文
posted @ 2018-02-24 10:52 此生不换Yang 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 在浏览器地址栏输入https://www.seleniumhq.org/ 打开Selenium官网 下载Firefox浏览器驱动 解压到本地 下载Chrome浏览器驱动 解压到本地 把这2个驱动放到Python的安装目录下 阅读全文
posted @ 2018-02-24 10:29 此生不换Yang 阅读(529) 评论(0) 推荐(0) 编辑