-
Notifications
You must be signed in to change notification settings - Fork 433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
idb ui describe-all not showing all UI elements. Those which are child of an element with "role_description":"group" are missing #767
Comments
All elements used to be shown, I have some output from 6 months ago (Sept 14, 2021) showing output from the bottom toolbar of the com.apple.mobilecal app; a couple of weeks later when I tried again (Sept 28, 2021) it wasn't working. Steps to reproduce
expected results: Inbox to be found as an AXLabel iPhone 12 Pro Simulator output for
|
@dlongmuir Is there an older version of idb I can use to overcome this problem? This is a major issue, I hope it gets fixed soon because it blocks automation on many UI elements in any app. |
I'm not sure although it would be something to try. I am unclear if this is an issue with idb itself or if there were underlying Xcode or Simulator changes that caused the change, so trying an older version of idb would help isolate the cause. |
I'd be happy to try and investigate this if someone could give me a point in the right direction towards where the describe-all response is being generated so I could set a breakpoint and work backwards from there (or any other suggestions someone who is more familiar with the code might have) |
I've looked at this a bit and could someone from the dev team confirm that this isn't fixable because the |
This is causing me issues when trying to use Maestro UITesting as my TabBar Buttons/elements are not available to query in
|
An alternative way for detecting UITabBarButton is using In my project, {
"AXFrame": "{{0, 761}, {390, 83}}",
"role_description": "group",
"AXLabel": "Tab Bar",
"type": "Group",
"children": [],
} Buttons are missing in {
"AXFrame": "{{2, 762}, {126, 48}}",
"role_description": "tab",
"AXLabel": "Home",
"type": "RadioButton",
"AXValue": 1,
"role": "AXRadioButton",
"subrole": "AXTabButton"
} Then I can programmatically detect all the buttons by code like: tab_bar = idb_ui_describe_all().get_tab_bar() # get attributes of TabBar
first_tab = idb_ui_describe_point(tab_bar.x+10, tab_bar.y+10) # an arbitrary point
num_tabs = tab_bar.width // first_tab.width
for i in range(1, num_tabs):
tab = idb_ui_describe_point(15+i*first_tab.width, tab_bar.y+10)
# ... do things with your tab I don't know why versions:
|
@hagemon I'm doing something similar but it is really slow. I'm still optimistic this will get fixed at some point. |
I was taking an effort to deal this issue, and found that it may be restricted by AppKit APIs. Concretely, with the latest release - (void)testAccessibility
{
FBSimulator *simulator = [self.control.set simulatorWithUDID:@"YOUR-DEVICE-UDID-HERE"];
NSArray<NSDictionary<NSString *, id> *> * result = [[[FBSimulatorAccessibilityCommands commandsWithTarget:simulator] accessibilityElementsWithNestedFormat:TRUE] await:nil];
NSLog(@"%@", result);
NSLog(@"--------------"); // set a breakpoint here
} The detailed operations:
With the original code, elements are of class
But after replacing Finally I check the difference between - (FBFuture<NSArray<NSDictionary<NSString *, id> *> *> *)frontmostApplicationForSimulator:(FBSimulator *)simulator displayId:(unsigned int)displayId nestedFormat:(BOOL)nestedFormat
{
return [FBFuture
onQueue:simulator.workQueue resolveValue:^(NSError **error) {
NSString *token = [self pushSimulator:simulator];
// translation for all elements
AXPTranslationObject *translation = [self.translator frontmostApplicationWithDisplayId:displayId bridgeDelegateToken:token];
translation.bridgeDelegateToken = token;
AXPMacPlatformElement *element = [self.translator macPlatformElementFromTranslation:translation];
element.translation.bridgeDelegateToken = token;
NSArray<NSDictionary<NSString *, id> *> *formatted = [self.class recursiveDescriptionFromElement:element token:token nestedFormat:nestedFormat];
[self popSimulator:token];
return formatted;
}];
}
- (FBFuture<NSDictionary<NSString *, id> *> *)objectAtPointForSimulator:(FBSimulator *)simulator displayId:(unsigned int)displayId atPoint:(CGPoint)point nestedFormat:(BOOL)nestedFormat
{
return [FBFuture
onQueue:simulator.workQueue resolveValue:^(NSError **error) {
NSString *token = [self pushSimulator:simulator];
// translation for element at point
AXPTranslationObject *translation = [self.translator objectAtPoint:point displayId:displayId bridgeDelegateToken:token];
translation.bridgeDelegateToken = token;
AXPMacPlatformElement *element = [self.translator macPlatformElementFromTranslation:translation];
element.translation.bridgeDelegateToken = token;
NSDictionary<NSString *, id> *formatted = [self.class formattedDescriptionOfElement:element token:token nestedFormat:nestedFormat];
[self popSimulator:token];
return formatted;
}];
} These two functions are declared in private headers from Apple, so I can't find out what happens inside. Hope someone can figure out these difference or if there is a proper way to use |
Is there anyone we can tag from the FB/IDB side to look at this? |
FYI, hope this saves someone some time - I just pulled latest and built idb_companion and this is still not returning the contents of the TabBar |
Description
idb ui describe-all command is expected to return complete hierarchy of UI Accessibility elements, and should match with the output of WebDriverAgent in order to migrate to idb. But in actual, all those UI elements are missing from the query result which are under a parent with type->Group / role_description->group)
Reproduction
Solution
Not Known
Additional Information
idb
revision: installed using command : pip3.6 install fb-idbThe text was updated successfully, but these errors were encountered: