UIAutomation's dragInsideWithOptions has no effect on iOS7 simulator

前端 未结 5 1788
没有蜡笔的小新
没有蜡笔的小新 2020-12-09 12:57

Since I use Xcode 5 and the new iOS 7 simulator to run UIAutomation tests with Instruments, dragInsideWithOptions and dragFromToForDuration functio

相关标签:
5条回答
  • 2020-12-09 13:12

    Another workaround: If you have a page control associated with your scroll view, use:

    pageIndicator = UIATarget.localTarget().frontMostApp().mainWindow().pageIndicators()[0];
    pageIndicator.selectPage(1);
    
    0 讨论(0)
  • 2020-12-09 13:13

    This is a bit old but it seems that dragInsideWithOptions is still not working.

    For a UIScrollView these methods can be used:

    scrollUp
    scrollDown
    scrollLeft
    scrollRight
    

    Source: https://developer.apple.com/library/prerelease/ios/documentation/ToolsLanguages/Reference/UIAScrollViewClassReference/index.html

    Ex:

    UIATarget.localTarget().frontMostApp().mainWindow().scrollViews()[0].scrollRight();
    

    Hope it helps!

    0 讨论(0)
  • 2020-12-09 13:19

    Same issue here. In addition to dragInsideWithOptions not working, dragFromToForDuration and flickFromTo aren't working either in Xcode 5 with iOS 7. I have been searching and waiting for a solution as well. Until then, swiping won't be possible.

    0 讨论(0)
  • 2020-12-09 13:19

    A workaround: if you want to swipe scroll views containing a button on a later page, just simply tap this (invisible) button, it "scrolls to visible" automatic. (Or call this invisible element's scrollToVisible() function.)

    0 讨论(0)
  • 2020-12-09 13:21

    same issue here.

    More than that, the documentation is missing for new iOS7 for everything related to UI Automation

    https://developer.apple.com/library/prerelease/ios/documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html

    Compare it with current doc, with full method list and description.

    https://developer.apple.com/library/ios/documentation/ToolsLanguages/Reference/UIAElementClassReference/UIAElement/UIAElement.html

    0 讨论(0)
提交回复
热议问题