WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Finding WPF panel in WinAppDriver

Open khoachung89 opened this issue 7 years ago • 5 comments

In my WPF window, i have panel (stack panel, grid panel...) In Inspector i can see them

cannotbefound

However i cannot select them with WinAppDriver (by accessibility, by class name....)

cannotbefound3 cannotbefound2

The other control like button or textbox can still be found normally. Is there anyway i can get the panel of WPF from WinAppDriver?

UPDATE: Looks like not only panel, but any control that doesn't have user interaction (a line for example) cannot be selected too. Is it a designation or a bug? I really need the panel coordination and size, without selecting it, how can i get it?

khoachung89 avatar Aug 20 '19 09:08 khoachung89

Close this issue because i can find them via XPath.

khoachung89 avatar Aug 23 '19 03:08 khoachung89

Hey, i am also facing the same issue, could you please provide the XPath what u have written to access that panel.

Vasanthi30 avatar Aug 27 '19 09:08 Vasanthi30

@Vasanthi30 You may have a look at your session's PageSource before write XPath query because it's much easier to see than using Inspector. My example case: WindowSession.FindElementByXPath("/Window/Pane") will return exactly the pane that I'm selecting in my question's screenshot. or: WindowSession.FindElementByXPath("/Window/Pane[@FrameworkId=\"WPF\"]").GetAttribute("ClassName") will return "ScrollViewer"

khoachung89 avatar Aug 27 '19 10:08 khoachung89

Many Thanks @khoachung89

Are you creating session similar to the below lines of code? DesiredCapabilities appCapabilities = new DesiredCapabilities(); appCapabilities.SetCapability("app", _applicationPath); appCapabilities.SetCapability("deviceName", "WindowsPC"); Session = new WindowsDriver(new Uri(WindowsApplicationDriverUrl), appCapabilities);

Vasanthi30 avatar Aug 27 '19 11:08 Vasanthi30

Yes, something like that.

On Tue, Aug 27, 2019, 6:26 PM Vasanthi30 [email protected] wrote:

Many Thanks @khoachung89 https://github.com/khoachung89

Are you creating session similar to the below lines of code? DesiredCapabilities appCapabilities = new DesiredCapabilities(); appCapabilities.SetCapability("app", _applicationPath); appCapabilities.SetCapability("deviceName", "WindowsPC"); Session = new WindowsDriver(new Uri(WindowsApplicationDriverUrl), appCapabilities);

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/microsoft/WinAppDriver/issues/818?email_source=notifications&email_token=AA7EXYKMEQJPG7HOBY2Q5LDQGUFPFA5CNFSM4INSM3M2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5HNCJI#issuecomment-525259045, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7EXYPGV5W62NTIHR6Z5BTQGUFPFANCNFSM4INSM3MQ .

khoachung89 avatar Aug 27 '19 11:08 khoachung89