报这个错,是因为你使用了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. python 核心编程课后练习(chapter 5)

    5-2 #5-2 def mul(x, y): return x * y print mul(4,5) 5-3 #5-3 def value_score(num): if 90<=num< ...

  2. linux VI search command 搜索 加入行号

    VI COMMAND:set number :set nonumber VI COMMAND/keywork   //search

  3. Add Office 365 Azure Directory into Windows Azure

    Add Office 365 Azure Directory into Windows Azure Pre-Requisite: 1.Azure Subscription to the Microso ...

  4. 进击的docker 二 : docker 快速入门

    1.安装docker 1.1.安装环境 [root@docker ~]# cat /etc/redhat-release CentOS Linux release (Core) [root@docke ...

  5. hibernate中的cascade和inverse

    以Student和class为例,一个Student对应一个class,一个class对应多个Student. Student.hbm.xml <?xml version="1.0&q ...

  6. C#如何分割多个空格分隔的字符串?

    using System; using System.Text; using System.Text.RegularExpressions; namespace test { class Progra ...

  7. Android IOS WebRTC 音视频开发总结(八十七)-- WebRTC中丢包重传NACK实现分析

    本文主要介绍WebRTC中丢包重传NACK的实现,作者:weizhenwei ,文章最早发表在编风网,微信ID:befoio 支持原创,转载必须注明出处,欢迎关注我的微信公众号blacker(微信ID ...

  8. 关于移动端常用的盒模型与flex布局

    在移动端选择布局的方式中常用盒模型display:-webkit-box达到自适应,然而display:-webkit-flex也同样能达到效果,因自在己移动端用-webkit-box比felx方式熟 ...

  9. JS函数

    1.document.write(""); 输出语句2.JS中的注释为//3.传统的HTML文档顺序是:document->html->(head,body)4.一个浏 ...

  10. PHP 7 的新特性

    PHP7是最新出来的一个新的PHP的一个版本,而且新增了一些新的版本特性,下面我们来介绍一下: 1.速度上比HHVM会快一些,大概是PHP5版本的9倍左右,下面是做的一个实验: <?php $a ...