Unable to locate Grids or Windows
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 AutomationProperties.AutomationId="MainWindowGrid"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> .....
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.
What is shown in inspect.exe?
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.
I get the same error with the AutomationId
No the one that comes with windows SDK. https://github.com/microsoft/WinAppDriver/blob/master/Docs%2FFAQ.md
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?
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?