add keywords Get Children, Get Children Locators - #94
Draft
zhajjhassan wants to merge 3 commits into
Draft
Conversation
…rieving properties using the newly added keywords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Get Children keyword always returned an empty list because AdapterFactoryImpl.get_children_adapters() was a stub (# TODO return []). This change implements the method using Finder.FindNodes() to resolve all direct children via XPath, following the same pattern as the existing get_adapter() method which uses FindSingleNode() for single element lookups.
ElementNode.RuntimeId was throwing NotImplementedException, which caused a crash when creating child adapters since RuntimeId is read to build unique locators. It now delegates to Helper.GetRuntimeId() which was already available but not wired up.
Additionally, a new Get Children Locators keyword is introduced. While Get Children returns context objects, Get Children Locators returns a list of full XPath locator strings built from the parent path plus each child's role and AutomationId or Name. These strings are human-readable in test logs and can be passed directly to other keywords like Activate or Get Property Value.
Type of Change
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
How Has This Been Tested?
Test Click All Calculator Digits Via Children
Test Test Get Children
Test Test Get Children Locators
Test Configuration:
OS: Windows 11 ARM64
Python: 3.13.13
Robot Framework: 7.4.2
.NET Runtime: CoreCLR
Test application: Windows Calculator (Rechner)
Checklist
Additional Notes
The C# project PlatynUI.Extension.Win32.UiAutomation must be rebuilt after pulling this change so the updated ElementNode.RuntimeId implementation is included in the DLL. Run dotnet build src/PlatynUI.Spy/PlatynUI.Spy.csproj to rebuild all dependent assemblies.