unittest中的Empty suite错误
import unittest
from selenium import webdriver class ibdata(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.driver = webdriver.Chrome()
cls.driver.maximize_window()
cls.driver.implicitly_wait(30)
cls.driver.get("http://www.ibdata.cn/#!/login") @classmethod
def tearDownClass(self):
self.driver.quit() def ibdata_login(self):
self.driver.find_element_by_xpath("/html/body/div/div/div[2]/div/div[1]/div[2]/div/div[2]/div[1]/div[1]/div/input").send_keys("xxxxxx")
self.driver.find_element_by_xpath("/html/body/div/div/div[2]/div/div[1]/div[2]/div/div[2]/div[1]/div[2]/div/input").send_keys("xxxxx")
self.driver.find_element_by_xpath("/html/body/div/div/div[2]/div/div[1]/div[2]/div/div[2]/div[2]/button").click() def ibdata_search(self):
pass if __name__ == "__main__":
unittest.main()
运行后显示:

我的解决办法是:测试用例以test开头,完美解决
class ibdata(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.driver = webdriver.Chrome()
cls.driver.maximize_window()
cls.driver.implicitly_wait(30)
cls.driver.get("http://www.ibdata.cn/#!/login") @classmethod
def tearDownClass(self):
self.driver.quit() def test_login(self):
self.driver.find_element_by_xpath("/html/body/div/div/div[2]/div/div[1]/div[2]/div/div[2]/div[1]/div[1]/div/input").send_keys("1xxxx")
self.driver.find_element_by_xpath("/html/body/div/div/div[2]/div/div[1]/div[2]/div/div[2]/div[1]/div[2]/div/input").send_keys("9xxxxg")
self.driver.find_element_by_xpath("/html/body/div/div/div[2]/div/div[1]/div[2]/div/div[2]/div[2]/button").click() def test_search(self):
pass if __name__ == "__main__":
unittest.main()

unittest中的Empty suite错误的更多相关文章
- python3的unittest中使用test suite(测试套件)执行指定测试用例
示例代码 module.py class baidumodule(): def __init__(self,driver,): self.dr = driver #不能在类中再次导入webdriver ...
- unittest报告出现dict() -> new empty dictionary错误解决办法
unittest报告出现dict() -> new empty dictionary错误解决办法 说一下原因,这是由于unittest中采用了ddt驱动. 由于版本问题导致 问题如图: 解决办 ...
- php调用empty出现错误Can't use function return value in write context
php调用empty出现错误Can't use function return value in write context 2012-10-28 09:33:22 | 11391次阅读 | 评论:0 ...
- unittest中更高效的执行测试用例一个类只需要打开一次浏览器
示例代码 baidu.py # _*_ coding:utf-8 _*_ import csv,unittest #导入csv模块 from time import sleep from seleni ...
- unittest中更多的测试用例
随着软件功能的不断增加,对应的测试用例也会呈指数级增长.一个实现几十个功能的项目,对应的单 元测试用例可能达到上百个.如果把所有的测试用例都写在一个 test.py 文件中,那么这个文件会越来越臃肿, ...
- unittest中的TestLoader使用
一:unittest中的TestLoader使用说明 第一步:unittest增加TestSuit() suite=unittest.TestSuite() 第二步:unittest增加Testloa ...
- 『心善渊』Selenium3.0基础 — 28、unittest中测试套件的使用
目录 1.测试套件的作用 2.使用测试套件 (1)入门示例 (2)根据不同的条件加载测试用例(了解) (3)常用方式(推荐) 1.测试套件的作用 在我们实际工作,使用unittest框架会有两个问题: ...
- xCode5 在ios7模拟器中出现__cxa_throw _pthread_exit错误
xCode5 在ios7模拟器中出现__cxa_throw _pthread_exit错误 2013年10月28日 ⁄ 综合 ⁄ 共 233字 ⁄ 字号 小 中 大 ⁄ 评论关闭 在项目中用模拟器 ...
- 在使用androidStudio中所遇到的错误
错误如下所示 Error:Execution failed for task ':app:processDebugResources'.> com.android.ide.common.proc ...
随机推荐
- 【easy】530. Minimum Absolute Difference in BST
找BST树中节点之间的最小差值. /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode ...
- 算法——八皇后问题(eight queen puzzle)之回溯法求解
八皇后谜题是经典的一个问题,其解法一共有种! 其定义: 首先定义一个8*8的棋盘 我们有八个皇后在手里,目的是把八个都放在棋盘中 位于皇后的水平和垂直方向的棋格不能有其他皇后 位于皇后的斜对角线上的棋 ...
- Http协议入门、响应与请求行、HttpServletRequest对象的使用、请求参数获取和编码问题
1 课程回顾 web入门 1)web服务软件作用: 把本地资源共享给外部访问 2)tomcat服务器基本操作 : 启动: %tomcat%/bin/startup.bat 关闭: %tomcat%/ ...
- electron Windows和mac 的菜单栏隐藏
1.Windows隐藏方法 const {electron,Menu,debug} = require('electron'); Menu.setApplicationMenu(null) 2.mac ...
- windows10中微软小娜cortana如何彻底卸载删除?
windows10中的Cortana可以通过语音干很多事情,但是对于我们来说用处不大,而且开机十分占用内存,下面教大家如何彻底的卸载并删除: 首先下载卸载Cortana的软件,下载链接:http:// ...
- C#冒泡法排序源码
如下内容内容是关于C#冒泡法排序的内容,应该对码农有一些用途. int[] myArray = new int[] { 10, 8, 3, 5, 6, 7, 4, 6, 9 }; for( int j ...
- CAS5.3.0安装部署
部署环境:JDK1.8.x maven-3.5.2 tomcat-8.x.x 1.下载地址 https://github.com/apereo/cas-overlay-template/tree/5. ...
- RxJS操作符(三)
一.过滤类操作符:debounce, debounceTime 跟时间相关的过滤 debounceTime自动完成:性能,避免每次请求都往出发 ); debounce中间传入Observable co ...
- 三大家族(offset、scroll、client)
offset.scroll.client三大家族 offset家族 offsetWidth 与 offsetHeight offset 偏移 用于获取元素自身的位置和大小 offsetWidth和of ...
- 2018-2019-2 网络对抗技术 20165239Exp3 免杀原理与实践
2018-2019-2 网络对抗技术 20165239 Exp3 免杀原理与实践 win10 ip地址 192.168.18.1 fenix ip地址为 192.168.18.128 (1)杀软是如何 ...