Cannot find stackview in accessibility indicator in XCUITest

半世苍凉 提交于 2019-12-10 17:49:14

问题


I'm writing UI test cases for my view controller.it has three views

1.A header view ->Stackview -> 4 buttons

2.table View

3.footer view - > 5 buttons

All views are accessible except stackview and its child buttons

Can anyone guide me how do i get reference of stackview and its child elements?


回答1:


Set the header view and stack view to be inaccessible and the child elements to be accessible. You can do this using the UIAccessibility API, setting isAccessibilityElement to false for the containers. On the views you want to interact with, set isAccessibilityElement to true and also set accessibilityIdentifier on each view.

If a container view is accessible, its child views are often obscured to avoid confusion about what the user is trying to interact with.



来源:https://stackoverflow.com/questions/44899898/cannot-find-stackview-in-accessibility-indicator-in-xcuitest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!