我正在使用Xamarin.UITest在iOS应用程序上执行自动化.
问题是:在访问图库上传照片时,有一个权限对话框,我需要点击"确定"按钮将其关闭.
以下我试过的方法,但它们没有用:
使用树命令不显示该对话框的层次结构,因此我无法找到要自动化的UI元素
使用
iOSApp.InvokeUia("UIATarget.localTarget().frontMostApp().alert().buttons()[\"OK\"].tap()");
显示的错误:
UIATarget.localTarget().frontMostApp().alert().buttons()["OK"] could
not be tapped because the element is not visible tap@[native code]
app.TapCoordinate,它似乎能够工作,但必须知道正确的坐标取决于不同的屏幕和对话框出现时.有没有解决这个问题的方法?谢谢.
试试这个: target.frontMostApp().mainWindow().elements()[0].elements()[2].elements()[1].tap()
| 归档时间: |
|
| 查看次数: |
1399 次 |
| 最近记录: |