【版本】

selenium:3.11.0

firefox:59.0.3 (64 位)

python:3.6.5

【代码】

 #coding=utf-8
from selenium import webdriver driver = webdriver.Firefox()
driver.get("http://www.baidu.com") driver.find_element_by_id("kw").send_keys("Selenium")
driver.find_element_by_id("su").click()
driver.quit()

【报错】

==================== RESTART: E:/python_work/1 firefox.py ====================
Traceback (most recent call last):
File "E:/python_work/1 firefox.py", line 7, in <module>
driver.find_element_by_id("kw").send_keys("Selenium")
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
return self._parent.execute(command, params)
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string

【解决方法】

升级geckodriver到v0.21.0已解决:https://github.com/mozilla/geckodriver/releases

【Selenium】【BugList7】执行driver.find_element_by_id("kw").send_keys("Selenium"),报错:selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string的更多相关文章

  1. 解决selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry'

    解决selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry'   ...

  2. 报错:selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: missing 'name'

    代码运行到这:driver.add_cookie(cookies),报错了 相信坑了不少人,接下来是解决办法 driver.add_cookie(cookies) cookies = { " ...

  3. Selenium click不生效 报错selenium.common.exceptions.InvalidArgumentException

    记录在使用selenium过程中踩的坑------ 在使用selenium时,用click点击网站弹出的文件上传框的"上传文件"按钮不生效,报错selenium.common.ex ...

  4. 自动化上传图片,路径driver.find_element_by_id("oper-img-change").send_keys("C:\\Users\\76776\\Pictures\\logo.jpg"),为正确姿势,单\报错 'unicodeescape' codec can't decode bytes in position XXX: trun

    自动化上传图片,路径driver.find_element_by_id("oper-img-change").send_keys("C:\\Users\\76776\\P ...

  5. robotframework执行用例时,报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinl

    在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: ...

  6. selenium.common.exceptions.ElementNotVisibleException: Message: element not visible处理方法:selenium针对下拉菜单事件的处理

    使用Selenium爬虫时,可能会遇到一些下拉菜单,动态加载,如果直接使用find_element_by_函数会报错,显示selenium.common.exceptions.ElementNotVi ...

  7. selenium调用Firefox和Chrome需要注意的一些问题,和出现的报错selenium:expected [object undefined] undefined to be a string

    在高版本selenium下如:selenium3.4.3 1.高版本的selenium需要浏览器安装一些补丁驱动 Firefox:geckodriver 下载网址:http://download.cs ...

  8. Python3+selenium 报错处理:“selenium.common.exceptions.NoAlertPresentException: Message: No alert is active”

    一.说明 在使用python3+selenium写自动升级程序的时侯,碰到一个弹出对话框需要点击确认的场景.弹出的对话框如下图所示. 对于弹框各种资料都说通过switch_to.alert属性获取对话 ...

  9. Appium问题解决方案(5)- selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session

    背景 使用Appium Server 1.15.1版本 执行了以下脚本 test = driver.find_element_by_name("自动化测试") print(test ...

随机推荐

  1. 删除pending.xml

    如果提示不能删除 需要在cmd命令行中执行如下命令 echo y|cacls D:\Windows\winsxs\reboot.xml /p everyone:f del /q D:\Windows\ ...

  2. AQS原理以及AQS同步组件总结

    1 AQS简单介绍 2 AQS原理

  3. css 之过渡效果

    之前写css的效果,都是使用js 来完成的,但是写js比较耗费时间,有时候逻辑不对,还出不来效果,所以也比较烦:所以一些简单的效果,就使用css 来完成会比较好一些,不必耗费太多的精力: 但是写css ...

  4. JS里的<!-- //--> 注释有什么作用

    早期浏览器有很多种(目前很少了),对HTML的解释也不同.有种纯文本浏览器,只“翻译”文本内容,并只支持少量HTML标签.对交互式的代码视同纯文本.因此,我们称其为不支持javascript的浏览器( ...

  5. NamedParameterJdbcTemplate

    NamedParameterJdbcTemplate 在经典的 JDBC 用法中, SQL 参数是用占位符 ? 表示,并且受到位置的限制. 定位参数的问题在于, 一旦参数的顺序发生变化, 就必须改变参 ...

  6. UE4 Creating 3D Widget Interaction

    https://docs.unrealengine.com/en-us/Engine/UMG/HowTo/InWorldWidgetInteraction

  7. 微信自带浏览器不支持form表单post提交方案解决

      微信自带浏览器form表单post提交,Java控制后台获取不到值得解决方案: 第一种:把post改成get请求,但是改后另一个问题来了就是,数据不安全了,连接上都能看到,导致数据会流失,Java ...

  8. setCapture 使用方法

    setCapture 可以捕获到 移动到浏览器外的鼠标事件. 例如拖动过程中,即使鼠标移动到了浏览器外,拖动程序依然可以执行! 作用就是把 把鼠标事件 捕获到 当前文档指定的对象! setCaptur ...

  9. 小A的位运算-(前缀和+位运算)

    https://ac.nowcoder.com/acm/contest/549/D 题意:从N个数里面选出N-1个数要让它们或起来的值最大. 解题: 假设n个数分别存在a数组里. 从左到右连续或运算结 ...

  10. 史上最全最详细的环境搭建教程,行百里者手把手教你在windows下搭建Anaconda+pycharm+库文件(TensorFlow,numpy)环境搭建

    我是在搭建TensorFlow开发环境的道路上走了很多弯路 掉了很多头发,为了让广大同学们不在受苦受累 下面我将手把手教你学习如特快速搭建python环境 快速导入numpy,PIL,pillow,等 ...