XUITest-无法使用iOS 11找到映像的生命点

XUITest-无法使用iOS 11找到映像的生命点,ios,image,ios11,xcuitest,Ios,Image,Ios11,Xcuitest,由于iOS 11 XUITest无法再找到UIImages的生命点,因此无法使用按(持续时间:然后拖动到:)点击图像或拖动触摸到图像 有一种解决方法可用于点击图像,该方法有效(使用坐标上的点击(使用规格化偏移:CGVector(dx:0,dy:0)))。同样的方法不适用于thenDragTo方法,因为它需要一个xguielement 有没有人知道如何让thenDragTo方法工作(最好不用编辑生产代码) 提前感谢它在我的Xcode 9.2测试中接受XUICoordinate extension

由于iOS 11 XUITest无法再找到UIImages的生命点,因此无法使用
按(持续时间:然后拖动到:)
点击图像或拖动触摸到图像

有一种解决方法可用于点击图像,该方法有效(使用
坐标上的
点击
(使用规格化偏移:CGVector(dx:0,dy:0))
)。同样的方法不适用于
thenDragTo
方法,因为它需要一个xguielement

有没有人知道如何让thenDragTo方法工作(最好不用编辑生产代码)


提前感谢

它在我的Xcode 9.2测试中接受XUICoordinate

extension XCUICoordinate {
    open func press(forDuration duration: TimeInterval, thenDragTo otherCoordinate: XCUICoordinate)
}
我可以这样使用它:

let fromCoordinate = contentElement.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5))
let toCoordinate = fromCoordinate.withOffset(CGVector(dx: 0, dy: 260))
fromCoordinate.press(forDuration: 0.01, thenDragTo: toCoordinate)

哦,当然。我在类型为XUIElement的对象上使用了
press(u:thenDragTo:)
方法,然后它只提供拖动到另一个XUIElement的功能(我想这是有意义的)。调用XCUI坐标上的
按(uuxThenDragto)
,我可以拖动到另一个坐标。。。谢谢