XCode7 ui测试:如何刷某个位置?

时间:2016-06-15 07:57:28

标签: xcode swipe xcode-ui-testing ui-testing

我想向左滑动屏幕。但我没有标签或按钮,其显示标签在录制过程中不会改变或可识别。所以我找不到要抓住并滑动屏幕的点。

是否有可能滑动某个屏幕坐标?

提前致谢!

2 个答案:

答案 0 :(得分:2)

您可以直接在应用程序甚至窗口上滑动。

let app = XCUIApplication()
app.swipeLeft()
app.windows.element.swipeLeft()

答案 1 :(得分:-1)

通过在随机屏幕位置录制一个水龙头来解决它。这给了我三行app.childrenMatchingType(.Window).elmentBoundByIndex(0).....element.childrenMatchingType(.Other).tap()

不知何故奇怪。但是我使用tap()更改了swipeLeft()并且结果已经确定了。

相关问题