【发布时间】:2020-03-28 15:44:40
【问题描述】:
我正在使用 Xamarin UITest 执行 UI 单元测试。我不知道如何让 UITest 框架点击 DisplayAlert(...) 按钮。
// this query finds the YES button on the Alert
app.WaitForElement( c => c.Marked( "YES" ).Parent().Class( "AlertDialogLayout" ), "ERR", TimeSpan.FromSeconds( 1 ) );
// but tap with the same query doesn't click it
app.Tap( c => c.Marked( "YES" ).Parent().Class( "AlertDialogLayout" ) );
【问题讨论】:
-
你可以参考这篇关于使用 Xamarin.UITest forums.xamarin.com/discussion/90847/…处理弹出窗口的帖子
-
@LeonLu-MSFT 我做到了,但我看不到如何在您的链接中单击弹出窗口上的 OK。我的问题专门针对找到“确定”按钮但不会点击或单击它的查询。