在 var = Watir::Browser.start 'url' 之后不能在 IRB 中使用变量 [英] Can not use variable in IRB after var = Watir::Browser.start 'url'

查看:28
本文介绍了在 var = Watir::Browser.start 'url' 之后不能在 IRB 中使用变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1.9.3-p327 :001 > require 'watir-webdriver'
=> true 
1.9.3-p327 :002 > b = Watir::Browser.new

然后firefox启动了,我什么也做不了.我的 IRB 不允许我输入新命令.

Then firefox starts and I can do nothing. My IRB does not allow me to enter new commands.

尝试了浏览器初始化的不同变体:

Tried different variations of browser initialization:

b = Watir::Browser.new :opera
b = Watir::Browser.new :firefox
b = Watir::Browser.start 'url'

应该出现如下内容:

=> #<OperaWatir::Browser:0x1496e57 @active_window=#<OperaWatir::Window:0x1eb1db2
@browser=#<OperaWatir::Browser:0x1496e57 ...>>,@driver=#
Java::ComOperaCoreSystems::OperaDriver:0xeabd2f>>

但是控制台没有输出.60 秒后浏览器关闭,我得到以下输出:

but there is no output in console. After 60 seconds browser closes and I get the following output:

1.9.3-p327 :002 > b = Watir::Browser.new
Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection
in 60 seconds (127.0.0.1:7055)

尝试过 chrome、firefox,浏览器打开,但 irb 锁.

Tried chrome, firefox, browser opens, but irb locks.

操作系统:Ubuntu

OS:Ubuntu

Ruby:2.0.0(也在 1.9.3 上试过)

Ruby: 2.0.0 (also tried on 1.9.3)

推荐答案

Selenium::WebDriver::Error::WebDriverError 无法获得稳定的 firefox 连接在 60 秒内 (127.0.0.1:7055) - 这通常发生在您的浏览器版本和 web-driver 版本不匹配时.我个人也观察到了同样的情况.唯一的解决方案是将 watir-webdriver 与其官方网站中记录的浏览器版本同步.

Selenium::WebDriver::Error::WebDriverError unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055) - this happened generally when your browser version and web-driver version not matched. I personally observed the same. Only solution is to synchronize watir-webdriver and your browser version as documented in their official site.

这里有一些关于事实的好资源:

Here are some Good resources of the fact:

资源1

resource2

资源3

希望能帮到你.

这篇关于在 var = Watir::Browser.start 'url' 之后不能在 IRB 中使用变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆