使用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 ...
随机推荐
- Query获取多种input值的方法
1 if($("input[name=item][value='val']").attr('checked')==true) //判断是否已经打勾 name即控件name属性,va ...
- mybatis mapper问题列表
id出现两次 2018-11-14 16:15:03.833 DEBUG 41432 --- [ main] c.a.i.o.d.mapper.DatvMapper.insert ...
- spring boot+jaspersoft实现复杂报表
1.实现效果: 2.下载 jaspersoft分为社区版和商业版,以下网址是社区版:https://community.jaspersoft.com/community-download
- OpenCV教程(转自:浅墨_毛星云博客)
2.图像的载入,显示和输出 一站式完全解析 本系列文章由@浅墨_毛星云 出品,转载请注明出处. 文章链接:http://blog.csdn.net/poem_qianmo/article/detail ...
- Spring注入的反射解释
对于如下配置片段: <bean id="id" class="lee.Aclass"> <!--property配置需要依赖注入的属性-- ...
- maya 安装失败
AUTODESK系列软件着实令人头疼,安装失败之后不能完全卸载!!!(比如maya,cad,3dsmax等).有时手动删除注册表重装之后还是会出现各种问题,每个版本的C++Runtime和.NET f ...
- [转]js add month 加n月
本文转自:http://stackoverflow.com/questions/5645058/how-to-add-months-to-a-date-in-javascript/5645126 I ...
- python 常见的异常类型
python标准异常异常名称 描述BaseException 所有异常的基类SystemExit 解释器请求退出KeyboardInterrupt 用户中断执行(通常是输入^C)Exception 常 ...
- Flume启动错误之:Bootstrap Servers must be specified
今天测试项目的时候需要启动Flume,然而在启动时遇到了Bootstrap Servers must be specified错误,错误日志如下: [kfk@bigdata-pro01 flume-- ...
- pat03-树1. 二分法求多项式单根(20)
03-树1. 二分法求多项式单根(20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 杨起帆(浙江大学城市学院) 二分法求函数根的 ...