UI Automation: Accessing a UIView Inside a UIScrollView

Is there a way to access using JavaScript with UI automation checks, UIViews inside a UIScrollView ? Since UIScrollView does not allow me to establish whether it has accessibility or not, I would like to know if this can be done.

Structure in XIB:

enter image description here

I can see everything in the tool log except for the UIScrollView and the UIViews inside it.

Thanks.

+2
source share
1 answer

I managed to access the interior of my scroll view. What I did wrong:

  • Configure the availability of my root view.
  • Setting accessibility for me is a customized view.

After that I was able to do this:

 var window = UIATarget.localTarget().frontMostApp().mainWindow(); window.logElementTree(); 

To see all the UIView inside my UIScrollView. To access one of the buttons:

  var scrollView = window.scrollViews()[0]; var button=scrollView.buttons()["showMeStuff"]; button.tap(); 

PS: You can also determine the availability of UIScrollView by doing the following:

  scrollView.isAccessibilityElement = YES; scrollView.accessibilityLabel = @"someScrollView"; 
+6
source

Source: https://habr.com/ru/post/899687/


All Articles