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 ...
随机推荐
- Nginx动态路由的新姿势:使用Go取代lua
导语: 在Nitro 中, 我们需要一款专业的负载均衡器. 经过一番研究之后,Mihai Todor和我使用Go构建了基于Nginx.Redis 协议的路由器解决方案,其中nginx负责所有繁重工作, ...
- cURL error 60: SSL certificate problem: unable to get local issuer
github 问题连接 https://github.com/yabacon/paystack-php/wiki/cURL-error-60:-SSL-certificate-problem:-una ...
- Springboot2新特性概述
官方说明: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.0-Release-Notes 起码 JDK 8 和支持 ...
- scrapy发送邮件
scrapy发送邮件 应用场景:在爬虫关闭或者爬虫空闲时可以通过发送邮件的提醒. 通过twisted的非阻塞IO实现,可以直接写在spider中,也可以写在中间件或者扩展中,看你具体的需求. 在网上找 ...
- 导出insert语句
--by zhuyj 显示&select ‘\&s’ from dual; --注意必须要加引号 --by zhuyjcreate or replace function fun_ex ...
- ASP.NET Core 中使用Session会话
添加Session Nuget包 更新Startup.cs文件 在ConfigureServices方法中添加如下代码 services.AddSession(options => { // S ...
- 前端开发,走浏览器缓存真的很烦,拒绝浏览器走缓存从meta标签做起!
<meta http-equiv="Cache-Control" content="no-cache" /> <meta http-equiv ...
- layUI 实现自定义弹窗
需求描述:点击表格中的数据,弹出一张具体信息表.描述的不是很清楚,放效果图,就明白了,上图 放心,能看到的数据,都不是生产数据,我造的假数据,但是功能效果就是这样,点击列表中的一行,弹出某些要展示的信 ...
- spring boot正常启动但是访问会找不到“ localhost 的网页”的错误
最近启动springboot项目访问localhost老报找不到网页,找了很久发现yml配置文件中配置了“context.path”,只要在端口号后面加上context.path地址就可以访问了. 如 ...
- ELK搭建<三>:安装Kibana
1.下载Kibana,如果需要低版本的,低版本下载 2.解压后,进入config修改配置文件kibana.yml : #运行的端口号 server.port: 5601 #服务器地址 server.h ...