WinAppDriver crashes when I call element.Text
See original GitHub issueI use element.FindElementsByXPath(“//*”) to get all child elements of a message box dialog. Then when I go through the element list calling subElement.Text on each causes WinAppDriver to crash on 4th sub element. I can see that the correct GET …/text is called but that kills WinAppDriver .exe. My application is a Windows Forms app that calls MessageBox.Show to show a message box dialog.
My test code is
[TestMethod]
public void MessageBox()
{
var capabilities = new DesiredCapabilities();
capabilities.SetCapability("app", @"D:\MessageBoxSample\bin\Debug\MessageBoxSample.exe");
var driver = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"), capabilities);
var window = driver.FindElementByAccessibilityId("Form1");
var button = window.FindElementByAccessibilityId("button1");
button.Click();
var messageBox = window.FindElementByClassName("#32770");
var elements = messageBox.FindElementsByXPath("//*");
foreach (var element in elements)
{
var str = element.Text;
}
}
You can find the MessageBoxSample.exe here MessageBoxSample.zip
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
WinAppDriver crashes when I call element.Text · Issue #405
I use element.FindElementsByXPath("//*") to get all child elements of a message box dialog. Then when I go through the element list calling ...
Read more >Winappdriver is crashed during UITest execution
I am testing desktop application and running UI test on CI pipeline. This error occurs randomly: TearDown : OpenQA.Selenium.
Read more >How To Automate Desktops Apps Using WinAppDriver
This blog deep dives by telling you How To Automate Desktops Apps Using WinAppDriver. It also leverages WinAppDriver on HyperExecute Cloud ...
Read more >UWP App Crash when inspecting the element using ...
we are trying to automate the uwp app using the Appium. we are using the winappdriver for same. we all automated the app...
Read more >Appium, WinAppDriver and UI testing - My Memory
WinAppDriver is a Microsoft driver that Appium calls into via it's API. ... will display and then on dispose, it quits and closes....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks. I can wait for the next version. The purpose of calling Text attribute of each element is just to collect the strings that are present on the UI at that moment. I am writing a localization testing tool. Previously be used UI automation on Windows but now studing if we can switch to WebDriver because we need use it anyway with web and mobile applications.
I am happy that you fix this because it is quite common that application just call Message.Show with one parameter like in my sample.
I tested a case when I also pass Caption and it indeed works.
Hi @timotiusmargo,
i would like to get a text from an app from the username field after sending keys to my project login username field, Send keys are working, but I’m unable to get a text from it. I’m used getText(), and also .getAttribute(“Value.Value”) , but both are not working. do you know any other way to get a text? Otherwise, is there any way to verify username fields without getting a text from it and make assertions??