首页 > 其他分享 >QA|selenium在send_keys时报错dict object has no attribute ''|UI自动化测试

QA|selenium在send_keys时报错dict object has no attribute ''|UI自动化测试

时间:2023-05-31 14:12:20浏览次数:56  
标签:no keys attribute selenium send dict

Q:selenium在send_keys时报错dict object has no attribute 'send_keys',如下图

 增加了print(type(e1))发现确实是字典类型,怪了,按道理e1的type应该是selenium.webdriver.remote.webelement.WebElement才对,怎么会变成dict字典呢?

我网上查了,按照(115条消息) Python运行selenium时报错‘dict‘ object has no attribute ‘send_keys‘解决fang‘an_翔空中,策人生的博客-CSDN博客说,肯定不是find_element_by_NAME,因为这个selenium包是我云桌面外的,外面运行正常的!

至于版本:

 

更换成对应版本,更换之后确实可以了

CNPM Binaries Mirror (npmmirror.com)

原因:selenium所用浏览器驱动是python.exe同层的那个,要保持与浏览器版本对应才行

 

解决:换成对应版本浏览器驱动,放到python.exe同层即可

 

标签:no,keys,attribute,selenium,send,dict
From: https://www.cnblogs.com/T-Better/p/17445942.html

相关文章

  • Could not autowire. No beans of 'AddressBookService' type found.
    错误:错误原因:Service实现类未继承Service接口解决方法: ......
  • Vue computed property values was assigned to but it has no setter
    vue文件中的核心代码写法<template><div><v-select:items="filters"label="查询条件"solodenseclass="select-size"v-model="filterKey"clearable></v-sele......
  • April 2023-Memory-efficient Reinforcement Learning with Value-based Knowledge Co
    摘要:人工神经网络在一般函数逼近方面很有希望,但由于灾难性遗忘,在非独立或非同分布的数据上训练具有挑战性。经验回放缓冲区(experiencereplaybuffer)是深度强化学习中的一个标准组件,通过将经验存储在一个大的缓冲区中并用于以后的训练,通常用于减少遗忘和提高样本效率。然而,较大......
  • node连接mongodb
    主要试用了两个库:mongodb、mongoose由于服务器使用的是比较老版本的mongodb,如果使用比较新的客户端,编译时会出现问题:Serveratxxxx:27017reportsmaximumwireversion4,butthisversionoftheNode.jsDriverrequiresatleast6(MongoDB3.6)终级解决方案:去掉类型constm......
  • Could not find the DLL(s) 'msvcp140_1.dll'. TensorFlow requires that these DLLs
      python-c"fromtransformersimportpipeline;print(pipeline('sentiment-analysis')('weloveyou'))"MicrosoftVisualC++Redistributableisnotinstalled,thismayleadtotheDLLloadfailure.                Itcanbedow......
  • python的peft包导入PeftModel时报importerror-cannot-import-name-unknown-location
    一般出现这种问题的原因是该版本的peft包中没有PeftModel,这种情况都需要降级。我验证了以下,我实在alpaca-lora项目中使用peft,alpaca-lora的项目大概在2个月以前更新,而peft包实在最近更新的4.0版本,而2个月以前peft还是2.0版本,所以我果断把peft降到2.0版本,然后问题就解决了。......
  • 在 Net Core 开发中如何解决 Cannot access a disposed object 这个问题
    一、简介NetCore跨平台项目开发多了,总会遇到各种各样的问题,我就遇到了一个这样的问题,不能访问Cannotaccessadisposedobject错误,经过自己多方努力,查阅资料,终于找到了解决办法,引发这个问题的原因大多数是多次读取请求Body流造成的,需要换一种获取请求Body流方法,不能使......
  • docker evel=error msg="error reading the kernel parameter net.ipv4.vs.expire_nod
    我使用的是dockerswarm-#报错evel=errormsg="errorreadingthekernelparameternet.ipv4.vs.expire_nodest_conn"error="open/proc/sys/net/ipv4/vs/expire_nodest_conn:nosuchfileordirectory"-#查看是否开启ip_vslsmod|grepip_vs==============......
  • git提交时报错not found: commitlint
    --全局安装npminstall-g@commitlint/cli--添加配置文件commitlint.config.js到项目下module.exports={rules:{//在这里添加你的规则//例如,要求提交消息的长度不超过50个字符'header-max-length':[2,'always',50]},};......
  • Gym - 100519I [NONE]
    题目链接:https://vjudge.net/problem/Gym-100519I 解题思路:先挂在这里#include<bits/stdc++.h>#defineinf0x3f3f3f3fusingnamespacestd;typedeflonglongll;constintmx=3e5+10;boolvis[mx];inttop,pri[mx];voidinit(){ for(inti=2;i<mx;i++){ if(!vis[i......