我下载了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:innew' 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:in {{ 1}} 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:in {{1} }初始化' 来自/Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/common/driver.rb:33:in {{1} }对于' 来自/Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver.rb:65: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
'
当我使用“https”时,我会看到以下内容 -
create_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
OpenSSL :: SSL :: SSLError:SSL_connect SYSCALL返回= 5 errno = 0 state = SSLv2 / v3 read server hello A 来自/Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:in
new' 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
阻止连接' 来自/Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:44:infor' from (irb):5 from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in
timeout' 来自/Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678:inbrowser = Selenium::WebDriver.for :remote, :url => "https://10.10.10.55:3001/wd/hub", :desired_capabilities => "ipad"
do_start' 来自/Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:626:inconnect' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/http.rb:678: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:in {{ 1}}请求” 来自/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 {{ 1}} 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:in {{1} }初始化' 来自/Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver/common/driver.rb:33:in {{1} }对于' 来自/Users/rohit/.rvm/gems/ruby-1.9.2-p290@playerTests/gems/selenium-webdriver-2.22.2/lib/selenium/webdriver.rb:65:intimeout' from /Users/rohit/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:89:in
'1.9。 2p290:007>
请建议,我做错了什么?
答案 0 :(得分:2)
为什么selenium-webdriver无法在ipad上运行: -
selenium-webdriver如何开始在ipad上工作: -
然后运行简单的ruby代码
红宝石'selenium-webdriver' driver = Selenium :: WebDriver.for:remote,:url => “http://10.10.10.88:3001/wd/hub”,:desired_capabilities => :ipad公司
desired_capabilities没关系,你可以给任何东西:iphone或:ipad
上面的ruby代码返回了我的对象,我可以这样做: -
driver.get“http://www.google.com”
所以,问题是为什么selenium-webdriver不能在低于5.0的iOS版本上工作,如4.3.3,4.3.1等。
感谢所有帮助过我的人。