XCode7 ui 测试:如何滑动某个位置?
XCode7 ui testing: How to swipe a certain location?
我想向左滑动屏幕。但是我没有标签或按钮,其显示标签在录制过程中不会改变或可识别。所以我找不到抓取和滑动屏幕的点。
是否可以滑动某个屏幕坐标?
提前致谢!
您可以直接在应用上滑动,甚至window。
let app = XCUIApplication()
app.swipeLeft()
app.windows.element.swipeLeft()
刚刚通过记录随机屏幕位置上的点击解决了这个问题。这给了我三行 app.childrenMatchingType(.Window).elmentBoundByIndex(0).....element.childrenMatchingType(.Other).tap()
有点奇怪。但是我用 swipeLeft()
改变了 tap()
并且成功了。