Appium 【ios】(新手入门)ruby 启动 selenium-webdriver 时超时 Net::ReadTimeout (Net::ReadTimeout)(高手请进)

chuyaoyao · 2014年04月14日 · 最后由 chuyaoyao 回复于 2014年04月17日 · 2117 次阅读

有个问题困扰了我好几天,我准备将这个问题梳理一下重新发出来
背景:
appium 版本 0.18
xcode 版本 5.1
真机 6.1 安装包 ipa 文件
代码:

require 'rubygems'
require 'appium_lib'
require 'selenium-webdriver'
capabilities = {
    'browserName' => 'iOS',
    'platform' => 'Mac',
    'version' => '6.1',
    'device' => 'iPhone Retina (4-inch)',
       'app' => "com.baidu.news.newstest"
}
server_url="http://127.0.0.1:4723/wd/hub"
@driver= Selenium::WebDriver.for(:remote, :desired_capabilities => capabilities, :url => server_url)
@driver.quit

appium 界面:

appium 此时没有明显的报错,log 如下:
info: App is an iOS bundle, will attempt to run as pre-existing

debug: Request received with params: {"desiredCapabilities":{"browserName":"iOS","platform":"Mac","version":"6.1","device":"iPhone Retina (4-inch)","app":"com.baidu.news.newstest"}}

info: Creating new appium session ae26adee-1e6f-475f-a1a7-807f9f43da0e
info: Removing any remaining instruments sockets
info: Cleaned up instruments socket /tmp/instruments_sock
info: Setting Xcode folder
info: Setting Xcode version

info: Setting iOS SDK Version

info: iOS SDK Version set to 7.1

info: Detecting automation tracetemplate

debug: Creating instruments

info: Not auto-detecting udid, running on sim
info: Localizable.strings is not currently supported when using real devices.
info: Not setting locale because we're using a real device
info: Not setting iOS and app preferences since we're on a real device
info: Starting iOS device log capture via idevicesyslog

info: Not setting device type since we're connected to a device

info: Installing ipa found at /Users/chuyaoyao/Desktop/newspages/baiduyuedu2.ipa
info: Creating iDevice object with udid 4a8e05203ae983e4c5f730a4b24ca02d72c6f814

debug: Nothing found on device, going ahead and installing.

debug: Starting instruments

info: Instruments is at: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments

info: [INSTSERVER] Instruments socket server started at /tmp/instruments_sock

info: Attempting to run app on real device with UDID 4a8e05203ae983e4c5f730a4b24ca02d72c6f814
info: Spawning instruments with command: /Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate -w 4a8e05203ae983e4c5f730a4b24ca02d72c6f814 com.baidu.news.newstest -e UIASCRIPT /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-uiauto/uiauto/bootstrap.js -e UIARESULTSPATH /tmp/appium-instruments
info: And extra without-delay env: {}
info: And launch timeouts (in ms): {"global":90000}

debug: Appium request initiated at /wd/hub/status

info: Responding to client with success: {"status":0,"value":{"build":{"version":"0.18.0","revision":"17af02875e50682d6f1bdbd7885dad6e54e1c08a"}},"sessionId":"ae26adee-1e6f-475f-a1a7-807f9f43da0e"}

debug: Request received with params: {}

GET /wd/hub/status 200 1ms - 199b
ruby 的报错信息:
/Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/protocol.rb:158:in rescue in rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/protocol.rb:152:in
rbuf_fill'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/protocol.rb:134:in readuntil'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/protocol.rb:144:in
readline'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http/response.rb:39:in read_status_line'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http/response.rb:28:in
read_new'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:1406:in block in transport_request'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:1403:in
catch'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:1403:in transport_request'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:1376:in
request'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:1369:in block in request'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:852:in
start'
from /Users/chuyaoyao/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:1367:in request'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/remote/http/default.rb:83:in
response_for'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/remote/http/default.rb:39:in request'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/remote/http/common.rb:40:in
call'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/remote/bridge.rb:634:in raw_execute'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/remote/bridge.rb:99:in
create_session'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/remote/bridge.rb:68:in initialize'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/common/driver.rb:33:in
new'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver/common/driver.rb:33:in for'
from /Users/chuyaoyao/.rvm/gems/ruby-2.0.0-p451/gems/selenium-webdriver-2.41.0/lib/selenium/webdriver.rb:67:in
for'
from build.rb:12:in `

'

共收到 3 条回复 时间 点赞

手工访问下 /wd/hub/status 试试

背景:
appium 版本 0.18
xcode 版本 5.1
真机 6.1 安装包 ipa 文件------->你这 ipa 是什么证书打包的?

#2 楼 @2023484665 企业证书 添加的 UDID,发现这种情况行不通 ,手机越狱之后 就没有问题了

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册