iOS UIAutomation UIAActivityIndicator
加载内容时,我的根表视图上有一个活动指示器。我正在尝试测试指示器是否存在,但似乎无法获取 UIAActivityIndicator,也无法在应用程序元素树层次结构中的任何位置找到它。该指示器是根表视图的子视图,因此我希望它被视为该元素树的一部分,但我在任何地方都看不到它(除了屏幕上的物理位置)。
从 javascript 获取活动指示器还需要其他魔法吗?
埃德
I've got an activity indicator on my root table view while things get loaded. I'm trying to test for the presence of the indicator, but can't seem to get ahold of the UIAActivityIndicator, nor can I find it anywhere in the app element tree hierarchy. The indicator is a subview of the root table view, so I'd expect it to be seen as a part of that element tree, but I don't see it anywhere (other than physically on the screen).
Any other magic required to grab an activity indicator from javascript?
Ed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是我为在 iOS 中等待页面加载而构建的函数。您可以在函数代码执行之前传递一个可选的 preDelay,但它会等待 ActivityIndicator 对象变为 null 30 秒(每半秒尝试一次,共 60 次)。我已经扩展了 UIAutomation 工具,以便在点击对象时包含此命令。
This is the function I've built for waiting for page loads in iOS. You can pass an optional preDelay before the function's code executes, other than that it waits for the activityIndicator object to become null for 30 seconds (trying every half second, 60 times). I've extended the UIAutomation tool to encompass this command when I tap on objects.
这将等待 1 秒以便活动指示器出现。然后,它将等待其失效,超时值为 10 秒。将“进行中”替换为您的指标名称。
This will wait 1 second for activity indicator to appear. Then, it will wait for it to become invalid with a timeout value of 10 seconds. Substitute "In progress" for your indicator name.
下面的代码行解决了我的问题,
它等待活动指示器变为禁用(但在指示器从我们的视图中删除后,需要 1-2 秒才能变为禁用)
The below line of code solved my problem
its wait until the activity indicator become disable(but its take 1-2 more seconds to become disable after indicator removed from our view)