【问题标题】:Unable to swipe across on iOS simulator无法在 iOS 模拟器上滑动
【发布时间】:2015-06-18 13:02:12
【问题描述】:

我在尝试使用 ios 应用上的滑动功能时遇到问题。目前使用 Appium v​​1.3.5 和 Cucumber/RubyMine v7.04。

我尝试过使用一系列 x、y 坐标。但是我仍然只能滑动到一半,无法点击屏幕上的元素。

以前有人遇到过这个问题吗?

def self.hide_thread
action = Appium::TouchAction.new
action.press(x: 360, y: 70).move_to(x: 0, y: 70).release
sleep(1)
find_element(:xpath,"//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[1]/UIAButton[1]").click
end

请错误提示:

elementId 18 could not be tapped(Selenium::WebDriver::Error::UnknownError)
  ./features/step_definitions/hidden_threads.rb:82:in `hide_thread'
  ./features/step_definitions/hidden_threads.rb:102:in `/^Hide the thread$/'
  features/hidden_threads.feature:8:in `And Hide the thread'
Then Thread will be hidden       # features/step_definitions/hidden_threads.rb:105

【问题讨论】:

    标签: ios ruby cucumber appium


    【解决方案1】:

    对于 java,我找到了这个解决方案!您尝试让 ruby​​ 传递 deltax 和 deltay 而不是端点坐标,并在需要时更新此答案。 Check This answer

    1. swipe(100,200,10,20,300) => 从点 (100,200) 开始滑动并在点 (110,220) 结束,这意味着手指将从当前位置向右下方移动
    2. swipe(100,200,-10,20,300) => 从点 (100,200) 开始滑动并在点 (90,220) 结束,这意味着手指将从当前位置向左下方移动
    3. swipe(100,200,10,-2​​0,300)=> 从点 (100,200) 开始滑动并在点 (110,180) 结束,这意味着手指将从当前位置向右上方移动
    4. swipe(100,200,-10,-2​​0,300)=> 从点 (100,200) 开始滑动并在点 (90,180) 结束,这意味着手指将从当前位置向左上方移动

    【讨论】:

      猜你喜欢
      • 2011-11-13
      • 2017-02-27
      • 2016-07-19
      • 1970-01-01
      • 1970-01-01
      • 2014-01-11
      • 2015-11-10
      相关资源
      最近更新 更多