Accessing parent objects attributes
Dear community,
I have a struggle in coding a web test that I coulnd't solve for a couple of days now:
I have a combobox where the user can select items in the dropdown menu. All items have a data-test id string, so that they can be accessed.
Now I want to find out if a certain item is selected or not. The item with the data-testid doesn't have the selected attribute itself (it is of type "span") but the parent item (of type "li") has a aria-selected attribute.
So I want to access the attributes of the parent element to read the aria-selected attribute.
(the html structure I'm talking about can be seen in the attached screenshot)
The problem is that, when accessing the parent object via .Parent, then there are no attributes to this Parent object.
So how can I do this simple task of reading an attribute of the parent object?
This is really annoying so I'm hoping very much for help.
Thank you :)