Skip to content
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

Keyword "Find All Elements" fails (here: Property "ClassName" is "Not Supported") #160

Closed
JanR-W opened this issue Feb 28, 2024 · 2 comments · Fixed by #165
Closed

Keyword "Find All Elements" fails (here: Property "ClassName" is "Not Supported") #160

JanR-W opened this issue Feb 28, 2024 · 2 comments · Fixed by #165
Assignees
Labels
bug Something isn't working

Comments

@JanR-W
Copy link

JanR-W commented Feb 28, 2024

Hello,
in our AUT the UI elements have the property "ClassName" show up as "Not Supported":
image

Apparently this leads to an error when using the keyword Find All Elements (I'm using the rfdebugger library to debug my keywords interactively inside of my console, but the same error occurs if I use the keyword inside of my test scripts):

> ${edit}= Set Variable /Window/Pane[3]/Window/Pane/Pane/Window[2]/Edit[@Name='user_s']
# ${edit} = "/Window/Pane[3]/Window/Pane/Pane/Window[2]/Edit[@Name='user_s']
> Find All Elements ${edit}
! keyword: Find All Elements ${edit}
! handler execution failed: PropertyNotSupportedException: The requested property 'ClassName [#30012]' is not supported bei FlaUI.Core.FrameworkAutomationElementBase.GetPropertyValue[T](PropertyId property)

Would it be possible to extend Find All Elements with an (optional) argument so that it only tries to read the property of the found elements I actually need and know is supported in my AUT? If not specified it could keep its old behaviour to return all three properties (making it hopefully a non-breaking change to the keyword).

To make it hopefully a bit more clear: I'm thinking of something like this:

Keyword Arg1 Arg2 Arg3
Find All Elements <identifier> msg=None <property: Either XPATH or AUTOMATION_ID or CLASS_NAME or None, if not specified>
@JanR-W JanR-W changed the title Keyword "Find Alle Elements" fails (here: Property "ClassName" is "Not Supported") Keyword "Find All Elements" fails (here: Property "ClassName" is "Not Supported") Feb 28, 2024
@Nepitwin
Copy link
Member

Nepitwin commented Feb 29, 2024

@JanR-W
Thank you for reporting the issue.

This was not considered within the method that properties are not available.

def _find_all_elements(self, xpath: str):
        values = []
        elements = self._get_all_elements_by_xpath(xpath)
        for element in elements:
            values.append(AutomationElement(
                element.AutomationId,
                element.Name,
                element.ClassName,
                FlaUIDebug.GetXPathToElement(element)
            ))

        return values

Since these are accessed in the Find_All_Elements method and should be saved as a list, there is probably an exception within the execution on this element.

This is a bug that we will fix.

We could solve this with an argument that can be selected and also that there is simply an empty string.

@Nepitwin Nepitwin self-assigned this Feb 29, 2024
@Nepitwin Nepitwin added the bug Something isn't working label Feb 29, 2024
Nepitwin pushed a commit that referenced this issue Mar 1, 2024
Nepitwin pushed a commit that referenced this issue Mar 1, 2024
Nepitwin pushed a commit that referenced this issue Mar 5, 2024
@Nepitwin Nepitwin linked a pull request Mar 5, 2024 that will close this issue
Nepitwin pushed a commit that referenced this issue Mar 6, 2024
Nepitwin pushed a commit that referenced this issue Mar 7, 2024
Nepitwin pushed a commit that referenced this issue Mar 8, 2024
Nepitwin pushed a commit that referenced this issue Mar 8, 2024
Nepitwin pushed a commit that referenced this issue Mar 8, 2024
Nepitwin added a commit that referenced this issue Mar 8, 2024
* #160 Property exception handling

* #160 Property exception handling

---------

Co-authored-by: Andreas Sekulski <andreas.sekulski@gdata.de>
@JanR-W
Copy link
Author

JanR-W commented Mar 11, 2024

That was a very quick fix, thank you so much!

EDIT: I can also confirm that Find All Elements for me now works as intended 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants