question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Interfacing WPF controls

See original GitHub issue

Hi, Is it possible to support controls like the ComboBox, or ListView for WPF?

With TestStack.White it is possible to get cell of a ListView, select a ComboBox item by index, how do you do that with WinAppDriver testing a WPF application? for example:

var listView = myTestStackWindow.Get<ListView>(SearchCriteria.ByAutomationId(automationId));
var rowCount = listView.Rows.Count;
var gridPattern = listView.AutomationElement.GetCurrentPattern(GridPattern.Pattern) as GridPattern;
var cell = gridPattern.GetItem(row, column);
cell.TryGetCurrentPattern(ValuePattern.Pattern, out var valueObject);
var valuePattern = valueObject as ValuePattern;

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
naeemakramcommented, Oct 7, 2019

In WAD UI Recorder, what information is shown when you hover mouse on the ListView in question?

1reaction
paulovilacommented, Oct 7, 2019

@naeemakram, in the case of WPF bare in mind that SendKeys doesn’t reflect the user interaction with the mouse. I’d prefer avoid generating a different interaction because falsifies the aim of the test. For the case of

FindElementsByTagName("ListItem")

it doesn’t find any list, I wonder how to query the items works in general so that I can see the elements for example in a DevExpress ComboBoxEdit

Read more comments on GitHub >

github_iconTop Results From Across the Web

Controls - WPF .NET Framework
Creating an Instance of a Control​​ You can add a control to an application by using either Extensible Application Markup Language (XAML) or...
Read more >
How to implement custom interfaces in WPF UserControl ...
I have several WPF UserControls. Each of these controls implement an interface IStepEditor. The class declaration is as follow:
Read more >
WPF - Controls
WPF - Controls ; 1, Button. A control that responds to user input ; 2, Calendar. Represents a control that enables a user...
Read more >
How to Add WPF UI Controls to Your Desktop Application
Adding controls to a WPF Window simply involves selecting the desired control from the toolbox and drag-drop it onto the expected location on ......
Read more >
The WPF Menu control
Learn all about the WPF Menu control in this thorough walk-through article.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found