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
Accessing page content when using deeply nested React Navigation navigators on iOS Using Appium #14825
Comments
I think https://discuss.appium.io is a better place to ask such questions |
@KazuCocoa This isn't really a question. It seems to be broken and easily reproducible and has been for several months with no action: #13940 There is an issue with navigating 4+ levels deep and appium not correctly navigating. |
Do you have an example app? If this happened with vanilla XCTest (by Apple) or Safari inspector, we probably cannot do anything on Appium side. |
@KazuCocoa we were able to come up with a reproducible test. This repo shows that any time there is a certain level of depth to the components, Appium is unable to find the desired element. In this project, the buttons in |
Thanks @phillipkey. Could you please confirm if these controls are visible in the Xcode's Accessibility manager? |
@mykola-mokhnach yes. It is |
@phillipkey In such case please try Appium@beta. We've refactored page source generation there, so the xml source must be identical to the source generated by XCTest. Btw, you could use the |
Hi, @rajithaswoop. Try to use the solution from the thread: Use |
Hi, @SudakovDmitry , we already tried this solution and it's not working |
Hi, tried accessible={false} that is also not working. My controls are visible in the Xcode's Accessibility manager. i noticed something strange i am not sure why it is happening. Appium generated source is exactly going only upto 50 level deep. if my controls are not present till that level then appium is not able to find my controls. This repo code having the problem i am talking about. Attached the screenshot in which i travelled exactly 50 level after that the controls are grouped together and not able to find it individually. is there any other solution? |
50 is the default value set to prevent endless loops. You could customize it by changing the |
Its worked. you saved our time. thanks. |
Having same problem as @rajithaswoop and @phillipkey with iOS. I tried moving some screens to upper navigator levels and Appium finds elements fine. But in 5th deep level, Appium can't find them anymore. I'm using Appium v1.19.0-beta.0. Also, "accessible={false}" is not working. About 'snapshotMaxDepth', I'm setting it to 100, 200 or 300 and it is still stopping in 50. I thought that I was making a mistake when setting it, but if I set it to 5, 10, 20 I can see that limit. But with >50 is not working. |
@mykola-mokhnach When snapshotMaxDepth Setting is above 60, appium is keep spinning/loading and no elements are shown in Appium Version- 1.18.3 and 1.19.0-beta.0, even after increasing snapshotTimeout. |
@rajithaswoop Try to set the snapshot timeout to zero in appium@beta while retrieving the page source on this view. This would probably work, but the |
@mykola-mokhnach I tried setting snapshot timeout to zero in appium@beta version, still the attribute value is not visible and appium keep spinning/loading |
Unfortunately I cannot advice nothing without the detailed server log |
Closed because of no response |
@mykola-mokhnach, Sorry for the late response, need to get approval for sending the log, so now sharing the server log |
Hi everyone, Here you can find two logs of the same script and the same application. appium-server-not-working.txt Some other info:
|
@rajithaswoop It looks like WDA has not been updated properly for your beta installation. Make sure it was removed from the device and compiled again from source. I see it, because
Also, it helps to enable xcodebuild logging as it includes internal WDA traces |
@jlusnich I don't observe you set the |
@mykola-mokhnach WDA was removed from device and complied from source, still the problem exists, sharing the error log |
Sorry about that. Here with snapshotMaxDepth and customSnapshotTimeout.
|
(past comment in this issue) #14825 (comment) may be the hint |
I'm testing an iOS app,
I'm using Appium 2 Appium Inspector still loading and I don't the app source I want to get xpath element with Appium inspector Any help please |
Something that fixed the issue for our case was
that removed lots of the nested views |
We are setting up a new test environment using react native 0.70+ None of the previous suggestions above directly worked but we noticed that changing the scheme's Build Configuration from Debug to Release had an impact. This is with Appium 2. After this change, given that our application has a lot of nested views, updating the customSnapshotTimeout setting (and only this one) as recommended above was required. Cucumber tests and direct connections from inspect correctly worked after that... (they never worked with debug builds). |
Hi👋, A sample project(with button component on 100+ level) showing tests that fail in Old Architecture and pass when the app is built with New Architecture: maybe someone finds it helpful. |
How can we pass snapshotMaxDepth property to browserstack with appium? |
Hello, regarding this issue, I recently encountered it too. By debugging the React Native code, I found that when I added a testID to the view, Appium was able to detect the element. I hope this method can help everyone. |
@jlipps Any update on this ? |
@rajithaswoop We dont have any solution to increase the snapshot for it |
Experiencing on React Native 0.67.4 with React Navigation 6. |
Also seeing this issue with |
Same here. Fixes the issue. |
thanks so much! it solved our issue! |
actually, it did not. They changed the APP and created more nested elements in the "DOM" |
Am facing same issue with my app.. is it possible to resolve by using this "createNativeStackNavigator"? |
Well, maybe it solves, it is worth to try. |
Hey guys, |
We are currently facing this issue in Appium 1.20.2 . We are about to Automate the IOS Module in our company .We have choose the Appium for Automating the same. But we see clubbed data test selector everywhere . We also used all the tweaks mentioned in the comments above, @tamaniniandre Had added this issue to Apple as well but there is no update there , too. Currently we have added snapshotMaxDepth to 60 . We are able to see most of the DTI seperated, but this still is a genuine issue that we need to solve. Kindly help if we found a more better workaround in here |
Update:
accessible={false}
in the outer element and setaccessible={true}
in the inner element to interact with the inner elementsnapshotMaxDepth
customSnapshotTimeout
may help to control how deep Appium XCUITest get the element tree recursivelymobile: source
with https://appium.github.io/appium-xcuitest-driver/latest/execute-methods/#mobile-source withexcludedAttributes
visible
may help to make the load faster by skipping time consuming attribute resolutionpageSourceExcludedAttributes
settings does the same thing for a generalpage source
resulttestID
handling: https://github.com/wix/Detox/blob/master/website/versioned_docs/version-20.x/guide/test-id.mdproblem:
Does anyone have any experience with React Navigation 5 on iOS and nested navigators?
It appears that in appium once the navigation tree hits 5 nested navigators on iOS that instead of being able to access the current pages content it returns a single XCUIElementTypeOther element.
For instance if the navigation tree looks like Stack -> Tab -> Stack -> Tab then the content tree is rendered correctly
But if there’s an extra level such as Stack -> Tab -> Drawer -> Stack -> Tab then the content tree becomes that single XCUIElementTypeOther element
I had initial thought this could be down to not using the accessible prop correctly on the view containing the content (as this can cause similar behaviour) but after testing out a number of different nested navigation configurations and setting this prop on every view I believe it’s due to this.
I don’t have this issue on Android as the same structure works perfectly fine, is there just some config I’m missing?
Environment
The text was updated successfully, but these errors were encountered: