ios - 导航到主机时“在 rbuf_fill 中救援”[iPhoneDriver + Selenium Webdriver + Ruby]

标签 ios ruby selenium webdriver

尝试访问任何主机时开始接收:

[1] pry(main)> require "selenium-webdriver"
=> true
[2] pry(main)> driver = Selenium::WebDriver.for :remote, :url => "http://xxx.xxx.xxx.xxx:3001/wd/hub/", :desired_capabilities => :iphone
=> #<Selenium::WebDriver::Driver:0x..fb1a8bc1a0f688d1c browser=:iPhone>
[3] pry(main)> driver.get "http://google.com"
Timeout::Error: Timeout::Error
from /Users/apple/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/protocol.rb:146:in `rescue in rbuf_fill'

先决条件: - 只有真实的设备,iOS 模拟器上没有错误 - 最新版本的 iPhoneDriver/Selenium Webdriver, iOS5/iOS6 - 试过几个单位 (Mac OS) 并遇到同样的问题 - 几天前还工作得很好 - 不知道会发生什么 - 不会在 Andoid 上重现类似代码

最佳答案

这通常发生在存在某种网络连接问题时。有可能是你的 iPhone 运行速度太慢而无法处理 selenium 脚本。 所以增加超时时间。

试试这个

client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 180 # Increase the time if it takes longer to connect to the remote device 
driver = Selenium::WebDriver.for :remote, :url => "http://xxx.xxx.xxx.xxx:3001/wd/hub/", :desired_capabilities => :iphone, :http_client => client

关于ios - 导航到主机时“在 rbuf_fill 中救援”[iPhoneDriver + Selenium Webdriver + Ruby],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13844931/

相关文章:

testing - 如何停止或暂停错误的 playframework Selenium 测试?

objective-c - 可达性重复符号

使用 method_missing 进行 Ruby 元编程来制作 HTML DSL

mysql - 在单个 Ruby/MySQL 查询中加载整个链表

c# - 通过 Options 类或 DesiredCapability 禁用 IE 弹出窗口拦截器

html - 使用 Chrome 的元素的 XPath?

ios - 添加对自定义单元格的支持后,MessageKit Collection View 不显示任何单元格

ios - 如何使用UIViewPropertyAnimator实现360度旋转

ios - Swift中dataWithJSONObject的AnyObject.Protocol错误

mysql - ActiveRecord 根据引用方式显示具有不同属性的相同记录