我下载了 iwebDriver 项目并将其安装在 ipad 中。服务器在“http://10.10.10.55:3001/wd/hub”上启动。我想在上面点击“www.google.com”,但我得到了错误。我在下面粘贴代码和堆栈跟踪。
注意:它在 iOS 模拟器上完美运行,但在 ipad 上失败。我的 iPad 版本是 4.3.3,XCode 版本是 4.2,iOS SDK 是 5.1
require 'selenium-webdriver'
browser = Selenium::WebDriver.for :remote, :url => "http://10.10.10.55:3001/wd/hub", :desired_capabilities => "ipad"
browser.get "http://www.google.com"
我收到错误:-
URI::InvalidURIError: 方案 http 不接受注册表部分:(null):(null)(或错误的主机名?)来自 /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/ 1.9.1/uri/generic.rb:199:in
initialize' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/http.rb:78:in
initialize' 来自 /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:177:来自new' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:177:in
/Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/uri/common.rb:628:inparse' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/http/default.rb:57:in
request' 来自 /Users/rohit/.rvm/ gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/http/common.rb:40:incall' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/bridge.rb:598:in
raw_execute' 来自 /Users/rohit/.rvm/ gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/bridge.rb:92:increate_session' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/bridge.rb:68:in
从 /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/common/driver.rb:33:innew' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/common/driver.rb:33:in
for 初始化'来自 /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver.rb:65:infor' from (irb):5 from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in
'
当我使用 "https" 时,我看到以下内容 -
browser = Selenium::WebDriver.for :remote, :url => "https://10.10.10.55:3001/wd/hub", :desired_capabilities => "ipad"
OpenSSL::SSL::SSLError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 从 /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9 读取服务器 hello A。 1/net/http.rb:678:in
connect' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:in
block in connect' 来自 /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:44:intimeout' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:89:in
timeout '来自 /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:inconnect' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:637:in
do_start' 来自 /Users/rohit/.rvm/rubies/ ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:626:instart' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:1168:in
request' 来自 /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/ selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/http/default.rb:76:inresponse_for' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/http/default.rb:38:in
来自 /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/http/common.rb:40:in 的请求call' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/bridge.rb:598:in
raw_execute' 来自 /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/bridge.rb:92:increate_session' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/remote/bridge.rb:68:in
初始化'来自 /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/common/driver.rb:33:innew' from /Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/common/driver.rb:33:in
for' 来自 /用户/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver.rb:65:infor' from (irb):6 from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in
'1.9.2p290:007 >
请建议,我做错了什么?