使用selenium启动火狐浏览器,解决Unable to create new remote session问题
今天用火狐浏览器来做自动化,才启动就报错,提示不能创建新的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问题的更多相关文章
- 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 ...
- 7.解决在python中用selenium启动FireFox浏览器启动不了的方法
首次在利用python中的selenium启动FireFox浏览器时可能碰到如下问题 当输入如下代码时: from selenium import webdriver brower=webdriver ...
- selenium 启动ie 浏览器
selenium 启动ie 浏览器 var driver = new InternetExplorerDriver(@"IEDriverServer.exe路径"); driver ...
- Selenium 启动无头浏览器,只有chrome 和 firefox的,没有IE
使用无头浏览器,可以避免掉不确定的弹出框对脚本稳定性的影响,还能在脚本执行过程中省略掉了css 加载的时间. 以下是Selenium 启动无头浏览器的方法,只有chrome 和 firefox的. p ...
- 排错: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页面, ...
- Dashboard登录成功后 RuntimeError: Unable to create a new session key.
openstack按照官网docs部署horizon后,使用admin账号密码登录,但网页提示未知错误. 查看/var/log/httpd/error_log 提示这个:RuntimeError: U ...
- 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 ,输入域名,用户名,密 ...
- 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 ...
- python无法启动火狐浏览器且报错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”
安装了python2,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...
随机推荐
- Zabbix sql注入漏洞脚本执行反弹shell
exp检测是否存在SQL注入漏洞root@ubuntu:~# python zabbix.py http://ip:9090/+------------------------------------ ...
- oracle序列的缓存
在高并发的数据库系统中,序列的缓存也要相应的调大.现在看看数据库自己的一个高并发序列的定义. 当我们向数据库发送一个请求时,监听接待,然后oracle会启动一个后台进程(这个进程就是通常所说的数据库并 ...
- java——注解处理器
Java提供了两种方式来处理注解:第一种是利用运行时反射机制:另一种是使用Java提供的API来处理编译期的注解. 运行时通过反射:仅当定义的注解的@Retention为RUNTIME时,才能够通过运 ...
- “随机数”函数的 ES6 实现
生成一个指定长度的数字数组 const getNumArray = len => [...new Array(len).keys()]; const getNumArray = len => ...
- c++ 封装线程库 2
1.2线程回收: 首先得知道线程的两个状态: Joinable Detached 简单理解,如果一个线程是joinable的状态,那么这样的线程,就必须使用pthread_join来回收,否则程序结束 ...
- VBS 学习
VBS其他功能 获取系统用户名 DimWshNetwork Set WshNetwork =CreateObject("WScript.Network") strTaccount ...
- UGUI Slider
1.新建一个Cube命名为Player,在上面挂一个脚本命名为Player,脚本内容如下: using System.Collections; using System.Collections.Gen ...
- HDU 4334——Trouble——————【贪心&水题】
Trouble Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Su ...
- 第三方缓存软件memcached和redis异同
memcached和redis相同点:都是以键值对的形式来存储数据,通俗讲就是一个大的hashtable缓存数据都是存在内容中 key-value 不同点:memcached:1.一个key所对应的值 ...
- poj 2378 删点最大分支不超过一半
http://poj.org/problem?id=2378 这题和找重心基本一样,判断条件换一下就行 #include <iostream> #include <string> ...