python执行selenium报错
python + unittest + HTMLTestRunner 执行suite用例报错
Traceback (most recent call last):
File "C:/ws/Selenium-Framework-master/testsuites/TestRunner.py", line 48, in <module>
runner.run(createsuite1())
File "C:\Python27\Lib\HTMLTestRunner.py", line 628, in run
test(result)
File "C:\Python27\Lib\unittest\suite.py", line 70, in __call__
return self.run(*args, **kwds)
File "C:\Python27\Lib\unittest\suite.py", line 100, in run
self._handleClassSetUp(test, result)
File "C:\Python27\Lib\unittest\suite.py", line 153, in _handleClassSetUp
self._addClassOrModuleLevelException(result, e, errorName)
File "C:\Python27\Lib\unittest\suite.py", line 198, in _addClassOrModuleLevelException
result.addError(error, sys.exc_info())
File "C:\Python27\Lib\HTMLTestRunner.py", line 584, in addError
output = self.complete_output()
File "C:\Python27\Lib\HTMLTestRunner.py", line 558, in complete_output
return self.outputBuffer.getvalue()
AttributeError: '_TestResult' object has no attribute 'outputBuffer'
百度搜索,不能解决问题,谷歌无法上网,只能想办法单独执行用例,报错:
Failure
Traceback (most recent call last):
File "C:\Python27\Lib\unittest\suite.py", line 146, in _handleClassSetUp
setUpClass()
File "C:\ws\Selenium-Framework-master\testsuites\test_baidu_search.py", line 16, in setUpClass
cls.driver = browse.open_browser(cls)
File "C:\ws\Selenium-Framework-master\framework\browser_engine.py", line 45, in open_browser
driver.maximize_window()
File "C:\Users\Administrator\PycharmProjects\untitled\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 728, in maximize_window
self.execute(command, {"windowHandle": "current"})
File "C:\Users\Administrator\PycharmProjects\untitled\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 314, in execute
self.error_handler.check_response(response)
File "C:\Users\Administrator\PycharmProjects\untitled\venv\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: cannot get automation extension
from unknown error: page could not be found: chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=66.0.3359.181)
(Driver info: chromedriver=2.29.461591 (62ebf098771772160f391d75e589dc567915b233),platform=Windows NT 6.1.7601 SP1 x86_64)
查找原来是chrome 浏览器和chromedriver 版本不一致
虽然我下载了和chrome浏览器一致的chromdriver,也放到c盘widows目录环境变量中去了,但是在代码中指定的chromedriver 位置中存放的还是旧版本。更换好对应版本的chromedriver后就好了
我有另外一篇博客介绍怎么获取正确的chromdirver版本 :http://www.cnblogs.com/testway/p/8041937.html
python执行selenium报错的更多相关文章
- Jenkins执行selenium报错unknown error: cannot find Chrome binary
问题描述:在Pycharm中执行selenium测试用例,可以正常运行, 集成在Jenkins中,构建时,发现构建成功,但是查看Console Output,报错:unknown error: can ...
- 【Selenium】【BugList4】执行pip报错:Fatal error in launcher: Unable to create process using '""D:\Program Files\Python36\python.exe"" "D:\Program Files\Python36\Scripts\pip.exe" '
环境信息: python版本:V3.6.4 安装路径:D:\Program Files\python36 环境变量PATH:D:\Program Files\Python36;D:\Program F ...
- selenium执行js报错
selenium执行js报错 Traceback (most recent call last): dr.execute_script(js) File "C:\Python27\l ...
- Django中修改DATABASES后,执行python manage.py ****报错!UnicodeEncodeError
Django中修改DATABASES后,执行python manage.py ****报错!UnicodeEncodeError: 'latin-1' codec can't encode chara ...
- mac下python环境pip报错[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) 的解决方法
1.mac下python环境pip报错: issuserdeMacBook-Pro:~ issuser$ pip install pyinstallerCollecting pyinstaller ...
- 执行mysqld_safe报错:mysqld does not exist or is not executable
执行mysqld_safe报错: [root@edu data]# /usr/local/mysql5.7/bin/mysqld_safe --user=mysql160427 12:41:28 my ...
- 数据库执行sql报错Got a packet bigger than 'max_allowed_packet' bytes及重启mysql
准备在mysql上使用数据库A,但mysql5经过重装后,上面的数据库已丢失,只得通过之前备份的A.sql重新生成数据库A. 1.执行sql报错 在执行A.sql的过程中,出现如下错误:Got a p ...
- mysql执行update报错1175解决方法
mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...
- 转 sqlplus执行sql报错:ORA-01756:
1.sqlplus执行sql报错:ORA-01756: quoted string not properly terminated 分类: 技术 在SQLPLUS中执行SQL文件时 ...
随机推荐
- tornado输出json
只需要输出一个dict就自动会变成json http://www.tornadoweb.org/en/stable/web.html#tornado.web.RequestHandler.write
- java 八种基本数据类型之与对应的封装类之间的相互转化
迁移时间--2017年5月26日17:47:37 Author:Marydon 一.java数据类型之基本数据类型 UpdateTime--2017年1月9日17:31:14 (三)格式转换 1. ...
- Android插件化开发之解决OpenAtlas组件在宿主的注冊问题
OpenAtlas有一个问题,就是四大组件必须在Manifest文件里进行注冊,那么就必定带来一个问题,插件中的组件都要反复在宿主中注冊.像Service,ContentProvider等组件眼下没有 ...
- Ajax学习(二):模仿jQuery的Ajax封装工具
通过上一节的学习,基本了解Ajax的使用, 但是这样使用很麻烦,这里封装ajax为一个方法,作为一个ajax工具,传入相应参数就可以实现ajax的使用. 模仿jQuery的Ajax. 如下是jQuer ...
- nmake构建Geos库
1.下载源码包 下载地址 http://download.osgeo.org/geos/geos-3.6.1.tar.bz2 下载之后解压即可. 2.编译 geos源码包中自带了makefile.vc ...
- .NET 中的 async/await 异步编程
原文出处: Teroy 的博客 前言 最近在学习Web Api框架的时候接触到了async/await,这个特性是.NET 4.5引入的,由于之前对于异步编程不是很了解,所以花费了一些时间学习一下相关 ...
- Spring Cloud环境搭建: Eureka Server
项目目录结构, 总共三个文件 ├── pom.xml └── src ├── main │ ├── java │ │ └── com │ │ └── rockbb │ │ ...
- 【mysql】关于ICP、MRR、BKA等特性
一.Index Condition Pushdown(ICP) Index Condition Pushdown (ICP)是mysql使用索引从表中检索行数据的一种优化方式,从mysql5.6开始支 ...
- centos 7 系统启动不了 出现报错dependency failed for /mnt , dependency failed for local file systems
阿里云一台Ecs重启后启动不了,出现报错 dependency failed for /mnt , dependency failed for local file systems , 报错的原因 ...
- jeecg平台testDatagrid
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...