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

Finding WPF panel in WinAppDriver #818

Closed
khoachung89 opened this issue Aug 20, 2019 · 5 comments
Closed

Finding WPF panel in WinAppDriver #818

khoachung89 opened this issue Aug 20, 2019 · 5 comments

Comments

@khoachung89
Copy link

khoachung89 commented Aug 20, 2019

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
Copy link
Author

Close this issue because i can find them via XPath.

@Vasanthi30
Copy link

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

@khoachung89
Copy link
Author

@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"

@Vasanthi30
Copy link

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);

@khoachung89
Copy link
Author

khoachung89 commented Aug 27, 2019 via email

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