使用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 ...
随机推荐
- 转 python3中SQLLIT编码与解码之Unicode与bytes
#########sample########## sqlite3.OperationalError: Could not decode to UTF-8 column 'logtype' with ...
- HandlerInterceptor拦截器使用总结
简介 SpringMVC的处理器拦截器,类似于Servlet开发中的过滤器Filter,用于对请求进行拦截和处理. 常见应用场景 1.权限检查:如检测请求是否具有登录权限,如果没有直接返回到登陆页面. ...
- c++ 封装线程库 0
1.互斥锁简介 互斥锁主要用于互斥,互斥是一种竞争关系,用来保护临界资源一次只被一个线程访问. POSIX Pthread提供下面函数用来操作互斥锁. int pthread_mutex_init(p ...
- Zookeeper分布式集群部署
ZooKeeper 是一个针对大型分布式系统的可靠协调系统:它提供的功能包括:配置维护.名字服务.分布式同步.组服务等: 它的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效.功能稳定的 ...
- 工作采坑札记:1. Hadoop中的BytesWritable误区
1. 背景 近日帮外部门的同事处理一个小需求,就是将HDFS中2018年至今所有存储的sequence序列化文件读取出来,重新保存成文本格式,以便于他后续进行处理.由于同事主要做机器学习方向,对had ...
- Machine learning preface
Machine learning Preface Definition T: Task E: Experience P: Performance Sequence: T -> E -> P ...
- .NET面试题5
常见面试题目: 1. const和readonly有什么区别? 2. 哪些类型可以定义为常量?常量const有什么风险? 3. 字段与属性有什么异同? 4. 静态成员和非静态成员的区别? 5. 自动属 ...
- Aspose.Cells导入导出execl
插件:Aspose.Cells 没有安装office插件也能使用: 导出:不能使用ajax异步· /// <summary> /// 导出试题 /// </summary> / ...
- powerdesigner低版本打开高版本方式为只读导致无法保存PD只读read-only-mode
由于版本号不一致 打开PD文件后提示: 点击[确定]后打开,点击[取消]后打不开 但打开后修改完毕保存提示: 解决办法: pdm文件实际上是个xml文件,直接用文本编辑器打开该文件修改版本号即可 把根 ...
- 浅谈windows.onload()与$(document).ready()
浏览器加载完DOM后,会通过javascript为DOM元素添加事件,在javascript中,通常使用window.onload()方法. 在jquery中,则使用$(document).ready ...