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

Unable to locate Grids or Windows #1989

Open
phenry9999 opened this issue Mar 27, 2024 · 5 comments
Open

Unable to locate Grids or Windows #1989

phenry9999 opened this issue Mar 27, 2024 · 5 comments

Comments

@phenry9999
Copy link

I am trying to test drive a WPF application. I have the WinAppDriver loading properly, and the Driver as well opening up my application. However, when I try to FindElement for a Window or a Grid, I get an error.
OpenQA.Selenium.WebDriverException: 'An element could not be located on the page using the given search parameters.'

My find is quite simple IMHO.
var mainWindow = Driver.FindElementByAccessibilityId("MainWindowGrid");

Likewise the xaml is simple.

<Grid.RowDefinitions>

.....

It seems like the only thing I can find is a Button. What am I doing wrong that I cannot locate anything useful? Please help. Thank you.

@anunay1
Copy link

anunay1 commented Mar 28, 2024

What is shown in inspect.exe?

@phenry9999
Copy link
Author

phenry9999 commented Mar 28, 2024

I'm sorry, what is the inspect.exe tool? Do you mean after using the UIRecorder? I have both the automationid and a name in there but my Driver.FindBy methods give me errors.
Inspector

InspectorError

I get the same error with the AutomationId
InspectorError2

@anunay1
Copy link

anunay1 commented Mar 28, 2024

No the one that comes with windows SDK.
https://github.com/microsoft/WinAppDriver/blob/master/Docs%2FFAQ.md

@phenry9999
Copy link
Author

I found a copy of it. Trying it now. It shows the automation id I'm expecting when I hover over the menu option I want. What am I missing?
InspectorShowingAutomationId

@phenry9999
Copy link
Author

I think I found something. If I try to find the nested button, it won't find it....until I click the parent's File menu option. Is that required? Why can't it find the nested file menu exit button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants