At one point in my tests I need to interact with views that are inside Main Window
. When I do a po app.windows
, I get this:
Find: Target Application 0x1c40d7680
Output: {
Application, 0x1c4389170, pid: 4765, {{0.0, 0.0}, {375.0, 667.0}}, label: 'Mercedes PRO [testb2b]'
}
↪︎Find: Descendants matching type Window
Output: {
Window, 0x1c43890a0, {{0.0, 0.0}, {375.0, 667.0}}
Window, 0x1c438dc30, {{0.0, 0.0}, {375.0, 667.0}}
Window, 0x1c438dea0, {{0.0, 0.0}, {375.0, 667.0}}
Window, 0x1c438e6c0, Main Window, {{0.0, 0.5}, {375.0, 667.0}}
}
I need to query Main Window
since I have almost the same views in the first Window from this list, so I want to separate them. So, I tried querying it with app.windows["Main Window"]
, but it seems like Main Window
is not an identifier for a window view.
Printing all XCUIElementAttributes (like title
, value
, identifier
and so on) didn't give me much information (they are mainly empty strings). Also, I don't want to query it by position (like this: app.windows.element(boundBy: 3)
) since I'm not sure if this Window will always be at this position.
Is there another way to query Main Window
?