• 祝社区发展越来越好!!!

  • 最后一步:完成接口和 UI 自动化

  • 什么时候招有经验的呢?

  • #8 楼 @tongxiaoxing cucumber 是可以自动生成报告的

  • MacBook 释放磁盘空间记录 at November 10, 2015

    我十一在家直接进行了 factory reset,然后连系统都删了,才明白原来 MacBook 跟手机不是一样玩的。

  • 你不是说这个不是最新的吗?

  • 解决了 还是用的 swipe start_x: 200, start_y: 200, end_x: 200, end_y: 400, duration: 2000
    这里的 duration 单位是 ms 只要时间够长就好了

  • @eurekasaber 我还尝试了 swipe start_x: 200, start_y: 200, end_x: 400, end_y: 200, duration: 2

    log 也是成功的:

    info: [debug] Pushing command to appium work queue: ["swipe",{"startX":200,"startY":200,"endX":400,"endY":200,"steps":0}]
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"swipe","params":{"startX":200,"startY":200,"endX":400,"endY":200,"steps":0}}
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: swipe
    info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][768,1184]
    info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][768,1184]
    info: [debug] [BOOTSTRAP] [debug] Swiping from [x=200.0, y=200.0] to [x=400.0, y=200.0] with steps: 0
    info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"06731e8a-641d-4fbc-904d-c1ebfaec8d05"}
    info: <-- POST /wd/hub/session/06731e8a-641d-4fbc-904d-c1ebfaec8d05/touch/perform 200 22.435 ms - 76 {"status":0,"value":true,"sessionId":"06731e8a-641d-4fbc-904d-c1ebfaec8d05"}
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
    info: --> GET /wd/hub/session/06731e8a-641d-4fbc-904d-c1ebfaec8d05/source {}
    info: [debug] Pushing command to appium work queue: ["source",{}]
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"source","params":{}}
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: source
    

    只是看到了屏幕闪了下

  • @eurekasaber 尝试了 swipe start_x: 50, start_y: 200, end_x: 50, end_y: 400, duration: 2
    我在模拟器上没有看到任何变化,我想要下滑但是感觉好像在某个 unit 上横向移动了,unit 上横向移动是没有反应的

    log 中显示是成功的:

    info: [debug] Pushing command to appium work queue: ["swipe",{"startX":50,"startY":200,"endX":50,"endY":400,"steps":0}]
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"swipe","params":{"startX":50,"startY":200,"endX":50,"endY":400,"steps":0}}
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: swipe
    info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][768,1184]
    info: [debug] [BOOTSTRAP] [debug] Display bounds: [0,0][768,1184]
    info: [debug] [BOOTSTRAP] [debug] Swiping from [x=50.0, y=200.0] to [x=50.0, y=400.0] with steps: 0
    info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
    info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"23cea7bb-f191-4c8e-b645-c45c9ca717d9"}
    info: <-- POST /wd/hub/session/23cea7bb-f191-4c8e-b645-c45c9ca717d9/touch/perform 200 36.777 ms - 76 {"status":0,"value":true,"sessionId":"23cea7bb-f191-4c8e-b645-c45c9ca717d9"}
    info: --> GET /wd/hub/session/23cea7bb-f191-4c8e-b645-c45c9ca717d9/source {}
    info: [debug] Pushing command to appium work queue: ["source",{}]
    info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"source","params":{}}
    info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
    info: [debug] [BOOTSTRAP] [debug] Got command action: source
    
  • #1 楼 @chenhengjie123 现有的方法里面我没有找到现成的可以下滑的方法 所以需要自己封装 但是太弱了 能详细说说封装的吗?

  • Testerhome, 你还好吗? at July 31, 2015

    点赞 相较于其他的测试类网站或者群体 testerhome 很专业了
    走自己的路 让别人说去吧

  • 我在用 ruby 集合了 cucumber 现在各种坑各种爬:)

  • 我也遇到了 但是是在 5.1.0 现在是抛出一个 error message 我需要验证这个 message 抓不到

  • #2 楼 @chenhengjie123 是的 页面上看到是有的 但是实际还是要 click 一下才拿到 username 和 password。

  • 我的粗暴的解决方法:找到 Package_name:id/ef_logo 然后 click 一下,然后就找到了。

  • 都不好意思再编辑这个帖子了,再编辑一次:)
    我不明白为什么这个例子里面会有 Gemfile,实际是不需要的。
    然后关于卡在 bundle install 的今天解决了:
    http://appium.io/slate/en/tutorial/ios.html?ruby#install-overview

    gem update --system
    gem install --no-rdoc --no-ri bundler
    gem update
    gem cleanup
    gem uninstall -aIx appium_lib
    gem uninstall -aIx appium_console
    gem install --no-rdoc --no-ri appium_console
    
  • 我也遇到了这个问题:

    info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","deviceName":"Genymotion","appPackage":"Package_name","appActivity":"Activity_name","app":"apk_path"}}
    info: Client User-Agent string: appium/ruby_lib/7.0.0
    error: Trying to run a session for device 'android' but that device hasn't been configured. Run config
    

    我已经改成了 platformName 了,还有哪里有问题?Appium 是 1.2.0

  • #5 楼 @lihuazhang
    我的理解是我 bundle update 时会自动找到 Gemfile 来更新
    但是更新中我的 iMac 现在报的错如下
    (之前我已经很努力各种解决问题了,试过 google 各种了,现在依旧还在路上)

    Evas-iMac:engage_android_automation evahao$ bundle update
    Fetching gem metadata from https://www.rubygems.org/...........
    Resolving dependencies...
    Using awesome_print 1.6.1 (was 1.2)
    /Library/Ruby/Gems/2.0.0/gems/bundler-1.7.8/lib/bundler.rb:302: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
    Installing json 1.8.3 (was 1.8.2)
    Using mini_portile 0.6.2
    Using nokogiri 1.6.6.2
    Using ffi 1.9.10 (was 1.9.6)
    Using childprocess 0.5.6 (was 0.5.5)
    Installing multi_json 1.11.2 (was 1.10.1)
    Installing rubyzip 1.1.7
    Installing websocket 1.2.2 (was 1.2.1)
    Using selenium-webdriver 2.46.2 (was 2.44.0)
    Using blankslate 2.1.2.4
    Using parslet 1.5.0
    Using toml 0.1.2
    Using appium_lib 7.0.0 (was 3.0.3)
    Using builder 3.2.2
    Installing numerizer 0.1.1
    Installing chronic_duration 0.10.6
    Using diff-lcs 1.2.5
    Using gherkin 2.12.2
    Using multi_test 0.1.2 (was 0.1.1)
    Installing cucumber 1.3.20 (was 1.3.18)
    Installing mime-types 1.25.1
    Installing rest-client 1.6.9 (was 1.6.8)
    Installing rspec-core 2.14.8
    Installing rspec-expectations 2.14.5
    Installing rspec-mocks 2.14.6
    Using rspec 2.14.1
    
    NoMethodError: undefined method `size' for nil:NilClass
    An error occurred while installing sauce_whisk (0.0.13), and Bundler cannot continue.
    Make sure that `gem install sauce_whisk -v '0.0.13'` succeeds before bundling.
    

    然后我安装 sauce_whisk,没有加版本号是因为这个旧版本安装失败了,然后就觉得新版本会好装些

    Evas-iMac:engage_android_automation evahao$ gem install sauce_whisk
    Fetching: unf_ext-0.0.7.1.gem (100%)
    Building native extensions.  This could take a while...
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/ext/builder.rb:54: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
    Successfully installed unf_ext-0.0.7.1
    Fetching: unf-0.1.4.gem (100%)
    Successfully installed unf-0.1.4
    Fetching: domain_name-0.5.24.gem (100%)
    Successfully installed domain_name-0.5.24
    Fetching: http-cookie-1.0.2.gem (100%)
    Successfully installed http-cookie-1.0.2
    Fetching: rest-client-1.8.0.gem (100%)
    Successfully installed rest-client-1.8.0
    Fetching: sauce_whisk-0.0.18.gem (100%)
    ERROR:  While executing gem ... (NoMethodError)
        undefined method `size' for nil:NilClass
    Evas-iMac:engage_android_automation evahao$ gem install sauce_whisk
    ERROR:  While executing gem ... (NoMethodError)
        undefined method `size' for nil:NilClass
    

    iMac 我还在尝试中

    至于我的 MacBook 上出现的问题就是

    haohuiyan@haohuiyan:~/Documents/android_engage_automation$bundle update
    Fetching gem metadata from https://www.rubygems.org/...........
    Resolving dependencies...
    Using awesome_print (1.6.1) 
    Using json (1.8.3) 
    Using mini_portile (0.6.0) 
    
    Bundler::GemspecError: Could not read gem at /Users/haohuiyan/.rvm/gems/ruby-2.0.0-p247/cache/nokogiri-1.6.3.1.gem. It may be corrupted.
    An error occurred while installing nokogiri (1.6.3.1), and Bundler cannot continue.
    Make sure that `gem install nokogiri -v '1.6.3.1'` succeeds before bundling.
    
    haohuiyan@haohuiyan:~/Documents/android_engage_automation$gem install nokogiri
    Fetching: nokogiri-1.6.6.2.gem (100%)Fetching: nokogiri-1.6.6.2.gem
    ERROR:  Error installing nokogiri:
        invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/haohuiyan/.rvm/gems/ruby-2.0.0-p247/cache/nokogiri-1.6.6.2.gem
    
  • #3 楼 @lihuazhang
    其实之前我是用 ID 的, 但是目前看来这个问题是因为环境里面还缺东西
    继续 bundle update

    Gemfile 太坑了:
    source 'https://www.rubygems.org'
    
    gem 'appium_lib',         '~> 7.0.0'
    gem 'rest-client',        '~> 1.6.7'
    gem 'rspec',              '~> 2.14.1'
    gem 'cucumber',           '~> 1.3.15'
    gem 'rspec-expectations', '~> 2.14.5'
    gem 'spec',               '~> 5.3.4'
    gem 'sauce_whisk',        '~> 0.0.13'
    gem 'test-unit',          '~> 2.5.5'
    
  • 能帮我看看我的这个问题吗?都是 appium+cucumber, https://testerhome.com/topics/2876

  • #1 楼 @chenhengjie123 我重新编辑了 能再帮我看看嘛

  • Android UIAutomation 选型 at July 03, 2015

    最近新开了个 android 项目,ui automation 可以自由选型,所以我想尝试一下新的,或者说不同的。@anikikun @monkey

  • #2 楼 @lihuazhang 一直在用

  • 今天把 testerhome 精华帖转了一圈 发现如此好文 赞!

  • #30 楼 @miumiu 对 元素不存在的时候是会报错的 只能找其他按钮来判断
    在评论里面我们找到了解决方案 就是迂回的