AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘
最近在做测试的时候发现driver.find_element_by_id的源代码改了如下:
driver.find_element_by_id("j_username").send_keys("wanjiayang") # 填入用户名
driver.find_element_by_id("j_password").send_keys("19980618.wanjia") # 填入密码
继续使用会报错AttributeError: 'WebDriver' object has no attribute 'find_element_by_id'。
源码改为
def find_element(self, by=By.ID, value=None) -> WebElement:"""Find an element given a By strategy and locator.:Usage:::element = driver.find_element(By.ID, 'foo'):rtype: WebElement"""
这样就正常登录了
driver.find_element(By.ID, "j_username").send_keys("wanjiayang") # 填入用户名driver.find_element(By.ID, "j_password").send_keys("19980618.wanjia") # 填入密码
AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘相关推荐
- AttributeError: ‘WebDriver‘ object has no attribute ‘w3c‘
size = driver.get_window_size() # 获取手机屏幕大小,分辨率 print(size) 报错 AttributeError: 'WebDriver' object has ...
- 解决‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘问题
'WebDriver' object has no attribute 'find_element_by_xpath'问题 以前习惯使用WebDriver来直接操作,比如: dr = webdrive ...
- AttributeError: ‘LoginPage‘ object has no attribute ‘driver‘
#简单的po模式 #2022/8/7 from selenium import webdriver from selenium.webdriver.common.by import Byclass L ...
- Python错误:AttributeError: 'generator' object has no attribute 'next'解决办法
今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数 def liebiao(): for x in range(10): yield x #函 ...
- AttributeError: 'dict' object has no attribute 'status_code'
前端AJAX请求数据,提示错误:"AttributeError: 'dict' object has no attribute 'status_code'". 原因:是提示返回对象 ...
- Traceback (most recent call last): File AttributeError: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):File "<stdin>", line 1, in <module> Attribut ...
- 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘
解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...
- AttributeError: ‘FPDF‘ object has no attribute ‘unifontsubset‘
AttributeError: 'FPDF' object has no attribute 'unifontsubset' 目录 AttributeError: 'FPDF' object has ...
- AttributeError: ‘Series‘ object has no attribute ‘as_matrix‘
AttributeError: 'Series' object has no attribute 'as_matrix' 问题: y_test = test_shifted["y_t+1&q ...
最新文章
- 记一次订单号的重复事故
- Shell中的${}、##和%%使用范例
- eclipse常用快捷键汇总
- 计算机专业人大学排名,计算机专业学校排名哪些大学计算机专业比较好
- 【数据结构】之基本概念和术语
- Redis 是属于多线程还是单线程?
- Spring Cloud Ribbon –进行安全呼叫
- css 可编辑,如何设置DIV可编辑
- 制作作品图片_不懂人文后期制作流程?来,大师手把手教你
- 虚拟ip(VIP)实现原理
- 使用setBounds()函数设置Java布局
- 台式计算机无线网络连接打印机,台式机怎么样连接无线打印机
- 集合——数组容器笔记
- 杭电OJ第11页2075~2079算法题(C语言)
- @Transactional的四种隔离级别测试
- GAE 博客——B3log Solo 0.2.1 发布了!
- 22届春季校招实习试水之路1(Java后端)
- 运维之红帽管理员篇-----1. Linux系统简介 、 安装RHEL7系统 、 RHEL7基本操作
- <学习笔记> VBA_Line list_01
- link和@import的区别:
热门文章
- 【浅析三元锂与磷酸铁锂电池】
- 我的2011----再见2011!你好2012!
- 2023年哪款手机浏览器比较好用,最后一个吹爆它
- Godot教程中文版-脚本2(Scripting2)
- 客厅智能化(1、2)
- python实现语音播放_用Python播放音频,并实现倍速播放——pyaudio模块用法(1)-nrg文件怎么播放...
- MP4文件播放不了是什么原因?原因及解决办法分享!
- com.android.vovo,Android仿ViVO X6 极速闪充动画效果
- 社交社区论坛APP超高颜值UI界面
- 区块连中文书六本略读