Reputation: 23
I have an WPF application using CommunityToolkit.Mvvm, which is working and now I want to use FlaUI to create automated UI testing.
When I start application, I have window like this
But now user can change value on input fields, and after user change it I invoke recreate method for my ObservableCollection. Like this:
[ObservableProperty]
private ObservableCollection<PhaseMaterialsPresenter> _myCollection;
public void Recreate()
{
MyCollection.Clear();
foreach (var data in _newData)
{
MyCollecion.Add(data);
}
}
And UI still works fine, but after this Recreation, when I refresh list in FlaUInspect I have this list where each DataItem seems to be empty:
It seems that invoking Clear on an ObservableCollection makes this issue, where FlaUI can't recognize UI elements anymore. I also tried to create new collection and then simply assign my new collection to my old collection, but it also has the same result. Anyone know how to make FlaUI to "see" the same thing that I have in my app UI?
Upvotes: 0
Views: 48
Reputation: 23
I have found solution here https://github-wiki-see.page/m/FlaUI/FlaUI/wiki/Common-Issues
So my problem occured because I am using DevExpress controls, so all I had to do was to disable this static property:
ClearAutomationEventsHelper.IsEnabled = false;
I am leaving the comment here if someone else has similar problem.
Upvotes: 0