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

WinAppdriver cannot find Elements in Office Word 2016 #622

Closed
mlehinchenko opened this issue Mar 5, 2019 · 11 comments
Closed

WinAppdriver cannot find Elements in Office Word 2016 #622

mlehinchenko opened this issue Mar 5, 2019 · 11 comments
Assignees

Comments

@mlehinchenko
Copy link

WinAppDriver - 1.1
Microsoft Word 2016
We are developing build in plugin in Office Word 2016.
During version 1803 of Word we had no issues locating elements.
After upgrade to version 1808 - WinAppdriver cannot locate elements.
We had to downgrade but it is very crucial for us to have Word up-to-date.
Attaching an example of simple table prepared by devs in which WinAppDriver cannot locate elements.
Invisible content controls.docx

@hassanuz
Copy link
Contributor

hassanuz commented Mar 5, 2019

Hi @mlehinchenko,

Can you provide the following information:

What version of Windows?
What does Inspect.exe show up?
Can you try providing a pagesource file for us to see?
Does this issue persist on Word 1809?

Lastly, what attributes (AutomationID, XPath) are you using to identify the elements?

Thanks

@hassanuz hassanuz self-assigned this Mar 5, 2019
@jgilpin
Copy link

jgilpin commented Mar 6, 2019

Similarly, I'm also unable to use XPath to find elements in Outlook. By AutomationId/Name do work.

WinAppDriver - 1.1
Outlook For Office 365 MSO (16.0.11231.20164) 64-bit
Win 10 Enterprise 1803 (17134.590)

I tried Session.FindElementByXpath("/") or "/*" to try and get any element. No results.
Session.PageSource returns XML that matches with Inspect.exe
Also, I've tried by creating the Session with "app"="Root" for a DesktopSession and with "appTopLevelWindow" assigned to MainWindowHandle.ToString("X") after Outlook has opened past it's splash screen.

I tried running WinAppDriver directly from command prompt: winappdriver 127.0.0.1 4723/wd/hub
with admin privs and without.

Any thoughts for me to try?

@timotiusmargo
Copy link
Contributor

@jgilpin.

There is an active issue around Microsoft Outlook having multiple elements sharing runtimeId that WinAppDriver wasn't expecting. We are currently working on a fix that may alleviate your issue. Please stay tune.

@timotiusmargo
Copy link
Contributor

Hi @jgilpin, @mlehinchenko,

WinAppDriver v1.1.1 release properly handles the exception scenario where distinct elements share the same runtimeId. This issue prematurely terminate XPath element search in previous releases. Can you please give it a try to see if this fix the issue you encountered?

@mlehinchenko
Copy link
Author

mlehinchenko commented Mar 14, 2019

@timotiusmargo Will give it a try and let you know. thanks for your efforts.

@jgilpin
Copy link

jgilpin commented Mar 14, 2019

@timotiusmargo Will check out 1.1.1 today!

@mlehinchenko
Copy link
Author

mlehinchenko commented Mar 14, 2019

@timotiusmargo no luck
1808 word and WinApp 1.1.1
elements not found
Maybe I need to provide something else to help resolving it?

@jgilpin
Copy link

jgilpin commented Mar 14, 2019

@timotiusmargo 1.1.1 and desktopSession.FindElementByXPath() work for me in Outlook for Office 365 16.0.11328.20140 64-bit.

For others, my desktopSession is instantiated with Appium.Dotnet like this:
protected const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723/wd/hub";...

var appCapabilities = new OpenQA.Selenium.Appium.AppiumOptions(); appCapabilities.AddAdditionalCapability("app", "Root"); appCapabilities.AddAdditionalCapability("deviceName", "WindowsPC"); appCapabilities.AddAdditionalCapability("platformName", "Windows");

desktopSession = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities);

@mlehinchenko
Copy link
Author

@timotiusmargo hi once again, seems like my bad and it is working. Had to change a little bit strategy of searching but in the end everything seems to be OK. Thanks for help.

@mlehinchenko
Copy link
Author

@timotiusmargo Should I close the issue or it will be auto-closed?

@timotiusmargo
Copy link
Contributor

Thanks for the update @mlehinchenko! I'm glad the WinAppDriver v1.1.1 release successfully addressed the issue.

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

4 participants