python selenium 点击 报错v_python执行selenium报错
python + unittest + HTMLTestRunner 执行suite用例报错
Traceback (most recent call last):
File "C:/ws/Selenium-Framework-master/testsuites/TestRunner.py", line 48, in
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后就好了
python selenium 点击 报错v_python执行selenium报错相关推荐
- python 自动点击网页上按钮_python selenium自动化(一)点击页面链接测试
需求:现在有一个网站的页面,我希望用python自动化的测试点击这个页面上所有的在本窗口跳转,并且是本站内的链接,前往到链接页面之后在通过后退返回到原始页面. 要完成这个需求就必须实现3点: 1. 找 ...
- python 报错继续执行_Python报错不要慌,这三个关键词帮你解决问题!
本文转载自公众号"读芯术"(ID:AI_Discovery). 写代码必然会出现错误,而错误处理可以针对这些错误提前做好准备.通常出现错误时,脚本会停止运行,而有了错误处理,脚本就 ...
- python selenium 点击开始按钮_使用Selenium和Python单击一个按钮
I have the following code: Expand all When I click on expand all, the whole page loads. How can I do ...
- php调用selenium,通过PHP exec()执行Selenium webdriver
我构建了一个python脚本,它使用Selenium和Firefox加载一些网站并处理它们的内容.因为我想在PHP中使用该脚本的输出,所以我使用PHP的exec()函数.在 我的python测试脚本如 ...
- Ubuntu执行脚本报错-bash: ./send.py: /usr/bin/python: bad interpreter: Permission denied
在Ubuntu系统终端中,使用命令行如下命令行运行*.py文件: 执行脚本报错 root@ubuntu:/usr/bin/python# chmod a+x send.py root@ubuntu:/ ...
- python 模拟用户点击浏览器_python爬虫之selenium模拟浏览器
1.前言 之前在异步加载(AJAX)网页爬虫的时候提到过,爬取这种ajax技术的网页有两种办法:一种就是通过浏览器审查元素找到包含所需信息网页的真实地址,另一种就是通过selenium模拟浏览器的方法 ...
- HQL语句中数据类型转换,及hibernate中createQuery执行hql报错
一.HQL语句中数据类型转换: 我们需要从数据库中取出序号最大的记录,想到的方法就是使用order by子句进行排序(desc倒序),然后取出第一个对象,可是当初设计数据库时(我们是在原来的数据库的基 ...
- 在Linux执行命令报错”Arg list too long”的原因分析
http://www.yunweipai.com/archives/558.html 在Linux执行命令报错"Arg list too long"的原因分析 吞拿鱼手卷 于 3 ...
- 数据库执行sql报错Got a packet bigger than 'max_allowed_packet' bytes及重启mysql
准备在mysql上使用数据库A,但mysql5经过重装后,上面的数据库已丢失,只得通过之前备份的A.sql重新生成数据库A. 1.执行sql报错 在执行A.sql的过程中,出现如下错误:Got a p ...
最新文章
- 编写 Shell 脚本的最佳实践
- python print换行_聊聊 print 的前世今生
- 人人都是 DBA(X)资源信息收集脚本汇编
- 利用永恒之蓝入侵服务器复制文件,msf利用永恒之蓝进行漏洞攻击
- 使用相同的原计算机名新建DDC加入原有站点报错
- sm750显卡驱动linux版,M.2接口也能做显卡,慧荣科技提供图形显示芯片支持
- Liunx静态库和动态库
- Java进阶篇(六)——Swing程序设计(上),java面试题,java基础笔试题,BAT
- 【渝粤教育】国家开放大学2018年秋季 0056-22T知识产权法 参考试题
- SqlServer性能检测之Sql语句排查
- HTML 打开新页面 关闭,javascript打开新窗口同时关闭旧窗口
- python3 下 tkinter 的网页监控小程序
- SpringBoot搭建个人博客v1.0 - 博客管理功能实现(七)
- wordpress最佳架构_动物和宠物的24个最佳WordPress主题
- Tp5开启cookie和session安全传输secure和httponly
- 自定义vscode插件路径及离线安装VSIX说明
- 中国电信官方提醒:7类短信诈骗须警惕
- 春考计算机专业PS考点,春考辅导:春考PS的学习方法和技巧
- 在本地如何启动Vue项目
- Hive学习之路(二):Hive表操作详讲
热门文章
- MRD 和PRD的区别
- 206. echarts的map地图入门案例
- 大学生python实验心得体会_最新大学生实验心得体会范文汇总
- 使用RSD批量正射校正和批量融合高分1号卫星数据
- odoo 开发入门教程系列-安全-简介
- 规则引擎代码可视化编辑全梳理
- 【LCT】[COI2009] OTOCI
- 2022年12月国产数据库大事记-墨天轮
- vue npm run dev 提示To install them, you can run: npm install --save @/url
- Java中“...“的含义