报这个错,是因为你使用了selenium3+Firefox。在selenium3中,使用Firefox,需要添加驱动。

您可以从Github上下载驱动程序下载网址-  https://github.com/mozilla/geckodriver/releases/tag/v0.9.0

在代码中加入

System.setProperty("webdriver.firefox.marionette","C:\\Program Files (x86)\\Mozilla Firefox\\geckodriver.exe");
WebDriver driver=new FirefoxDriver();

C:\\Program Files (x86)\\Mozilla Firefox\\geckodriver.exe是驱动放置的位置

现在,您可以运行程序,你会得到期望的输出。

The path to the driver executable must be set by the webdriver.gecko.driver system property的更多相关文章

  1. NetBeans IDE驱动报错The path to the driver executable must be set by the web driver.chrome.driver.system property......

    问题:defaulstUserDataPath=C:\\Users\\user1\\AppData\\Local\\Google\\Chrome\\User Data\\Defaul 编译失败 解决 ...

  2. 找不到’geckodriver’ 的环境path问题“ Message: 'geckodriver' executable needs to be in PATH. ”

    运行测试脚本报找不到’geckodriver’ 的环境path  的错误 selenium3.x webdriver/firefox/webdriver.py的init中,executable_pat ...

  3. 【selenium 3】 Mac 下测试环境搭建 Firefox 47+ gecko driver Mac

    错误代码如下:File "/usr/local/lib/python2.7/dist-packages/selenium-3.0.0b2-py2.7.egg/selenium/webdriv ...

  4. selenium 3.0 beta2 初体验

    经过漫长的等待,终于迎来了selenium 3.0 从selenium 1.0 至今,差不多有十多年的历史.这个月终于迎来了selenium3.0 那么selenium3.0 为我们带来了什么? 看一 ...

  5. Selenium 3 -how to locate the chromedriver and geckodriver place?

    Maybe you met these exceptions sometimes: 1. Chrome Driver The path to the driver executable must be ...

  6. 关于Selenium WebDriver的geckodriver

    下载Selenium的最新版本地址:http://selenium-release.storage.googleapis.com/index.html 友情提示:如果一直下载不了,可能是浏览器与下载工 ...

  7. Selenium问题总结

    1.Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox b ...

  8. 跟浩哥学自动化测试Selenium -- 我的第一个Demo (2)

    我的第一个Demo 开始写第一个 Demo 之前,先熟悉一下编写 Selenium 脚本的四个步骤: 驱动路径写法分析:System.setProperty 主要做用是设置系统属性,第一个参数为系统属 ...

  9. Remote使用出现的问题及解决办法

    最近尝试跟着虫师的OP模式所写的bbs代码,应用自己的项目尝试修改,在第一步Remote启动Firefox上便出错,当前selenium2.53,firefox47.1,selenium server ...

随机推荐

  1. Java基础(一) ---- 封装(Encapsulation)

  2. listview 模仿用户点击事件。

    正确的方法 gvFlow.post(new Runnable() { @Override public void run() { gvFlow.performItemClick(gvFlow.getC ...

  3. opendove中的odgw所需要的内核模块

    最近组里要做opendove相关的东西,需要odgw的一个kernel-module. 以前安装过,但备份不见了,在此做个链接备忘 : https://git.opendaylight.org/ger ...

  4. AngularJS-chapter1-2-四大特性

    4大特性 MVC MVC实例  数据模型,控制器,视图 HelloAngular_MVC.html 图中的 ng-controller="HelloAngular"  定义了Hel ...

  5. matlab clear

    clear 删除工作空间中的项目,释放系统内存 语法: clear clear name clear name1 name2 name3... clear global name clear -reg ...

  6. Setup QT 5.5.1 + OpenCV 3.0 + Visual Studio 2013 on windows 10

    1. Install Visual studio 2013 community version which is free to use for personal usage. 2. Setup th ...

  7. [转载]jquery中attr和prop的区别

    在高版本的jquery引入prop方法后,什么时候该用prop?什么时候用attr?它们两个之间有什么区别?这些问题就出现了. 关于它们两个的区别,网上的答案很多.这里谈谈我的心得,我的心得很简单: ...

  8. 使用php技术实现无刷新的上传文件

  9. win7和Ubuntu双系统折腾记

    哎,最近老是写些没涵养的博客.哥们问我怎么不分享点cv的论文思路,或者搞点深度学习调参的经验.因为真正跑深度学习搞 计算机视觉的时候,时间悄悄过去了,只有环境出Bug了,才是我最难受的时候,每一次搞好 ...

  10. Hibernate—— 一对多 和 多对多关联关系映射(xml和注解)总结(转载)

    One to Many 映射关系 多对一单向外键关联(XML/Annotation) 一对多单向外键关联(XML/Annotation) 懒加载和积极加载 一对多双向外键关联(XML/Annotati ...