今天用火狐浏览器来做自动化,才启动就报错,提示不能创建新的session,不能启动浏览器

问题原因:

火狐driver与火狐浏览器与selenium版本的不兼容

我使用的火狐driver是0.21.0 版本,下载地址:https://github.com/mozilla/geckodriver/releases

使用的火狐浏览器版本是60,下载地址:http://www.firefox.com.cn/download/

使用selenium-java的版本是3.12.0,因为是使用的maven,maven配置为

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.12.0</version>
</dependency>

  调试的代码为

public class firefoxsrun {
WebDriver driver;
@BeforeClass
public void beforeClass(){
System.setProperty("webdriver.gecko.driver", "resources/geckodriver.exe");
driver = new FirefoxDriver();
driver.get("http://www.baidu.com"); } @Test
public void test2(){
System.out.println("成功啦");
driver.findElement(By.id("kw")).sendKeys("testurl");
driver.findElement(By.id("su")).click();
} }

  我的diver就放在我的项目目录下的resource下

使用selenium启动火狐浏览器,解决Unable to create new remote session问题的更多相关文章

  1. java selenium启动火狐浏览器报错:Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:14.666Z

    Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: VISTA Build in ...

  2. 7.解决在python中用selenium启动FireFox浏览器启动不了的方法

    首次在利用python中的selenium启动FireFox浏览器时可能碰到如下问题 当输入如下代码时: from selenium import webdriver brower=webdriver ...

  3. selenium 启动ie 浏览器

    selenium 启动ie 浏览器 var driver = new InternetExplorerDriver(@"IEDriverServer.exe路径"); driver ...

  4. Selenium 启动无头浏览器,只有chrome 和 firefox的,没有IE

    使用无头浏览器,可以避免掉不确定的弹出框对脚本稳定性的影响,还能在脚本执行过程中省略掉了css 加载的时间. 以下是Selenium 启动无头浏览器的方法,只有chrome 和 firefox的. p ...

  5. 排错:Unable to create a new session key. It is likely that the cache is unavailable.

    排错:Unable to create a new session key. It is likely that the cache is unavailable. 问题 登录openstack页面, ...

  6. Dashboard登录成功后 RuntimeError: Unable to create a new session key.

    openstack按照官网docs部署horizon后,使用admin账号密码登录,但网页提示未知错误. 查看/var/log/httpd/error_log 提示这个:RuntimeError: U ...

  7. openstack中dashboard页面RuntimeError: Unable to create a new session key. It is likely that the cache is unavailable.

    环境是centos7,直接跑在服务器上. 按照官网一步步安装openstack,到验证dashborad时出错. 登录http://192.168.1.73/dashboard ,输入域名,用户名,密 ...

  8. openstack RuntimeError: Unable to create a new session key. It is likely that the cache

    [Mon Apr 15 01:02:31.654247 2019] [:error] [pid 19433:tid 139790082479872] Login successful for user ...

  9. python无法启动火狐浏览器且报错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”

    安装了python2,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...

随机推荐

  1. HttpClient,Socket,URL知识

    java中: tip/ip  , udp  传输协议 网络编程有三大类:Socket,URL,datagram HTTP协议是建立在TCP协议之上的一种应用. 一:HttpClient HttpCli ...

  2. RequestContextHolder与RequestContextUtils

    org.springframework.web.servlet.support.RequestContextUtils 在spring-webmvc中, 主要用来获取WebApplicationCon ...

  3. ubuntu同时装有MXNet和Caffe框架

    我阐述一下我遇到的问题:因为之前装过caffe,最近装了MXNet.MXNet可以运行,但import caffe就不行了,找不到模块. 那应该怎么处理呢??? 参考了一下这个网站:https://i ...

  4. ajax 工作原理以及其优缺点

    1.什么是AJAX?AJAX全称为“Asynchronous JavaScript and XML”(异步JavaScript和XML),是一种创建交互式网页应用的网页开发技术.它使用:使用XHTML ...

  5. Message Unable to connect to SQL Server '(local)'

    最近在sql server 加了一些job,但是run job的时候发生了一下错误: ssage Unable to connect to SQL Server '(local)' 问题根源:调用 T ...

  6. Vue.js-----轻量高效的MVVM框架(二、Vue.js的简单入门)

    1.hello vue.js! (1)引入vue.js <script type="text/javascript" src="js/vue.js"> ...

  7. 使用codesmith无法连接mysql问题

    最近研究codesmith的用法,遇到了如题的问题,记录一下解决的方法. 1.问题描述: 在codesmith中选择MySQLSchemaProvider并连接数据库时,会报以下错误: Test fa ...

  8. python + selenium 练习篇 - 定位元素的方法

    1.利用ID定位元素(能直接通过ID来定位的元素比较少) # coding=utf-8from selenium import webdriverdriver = webdriver.Chrome() ...

  9. bootstrap3-dialog:更强大、更灵活的模态框(封装好的模态框)

    用过bootstrap框架的同学们都知道,bootstrap自带的模态框用起来很不灵活,可谓鸡肋的很.但nakupanda开源作者封装了一个更强大.更灵活的模态框——bootstrap3-dialog ...

  10. nodejs --- crypto实现加密(转)

    crypto实现加密 本文转自:http://www.liaoxuefeng.com/wiki/001434446689867b27157e896e74d51a89c25cc8b43bdb3000/0 ...