app.DragAndDrop()如何在xamarin ui测试中工作

时间:2017-12-07 11:22:47

标签: c# xamarin.uitest

我有列出帐户的图块。我想将一个拖到另一个的位置并尝试下面的代码,但似乎都不起作用:

AppResult[] fro = app.Query(x => x.Id("reorder_icon").Sibling().Marked(fromAccount));
AppResult[] t = app.Query(x => x.Id("reorder_icon").Sibling().Marked(toAccount));

app.DragCoordinates(fro.FirstOrDefault().Rect.CenterX, fro.FirstOrDefault().Rect.CenterY, t.FirstOrDefault().Rect.CenterX, t.FirstOrDefault().Rect.CenterY);
app.DragAndDrop(x => x.Id("reorder_icon").Sibling().Marked(fromAccount),x => x.Id("reorder_icon").Sibling().Marked(toAccount));

1 个答案:

答案 0 :(得分:0)

我不得不联系Xamarin以解决此问题。他们现在已经为DragAndDrop()方法添加了功能,以确保可以执行相关描述的行为。