diff --git a/src/Samples.UITest/Writer.Test/Tests/WriterTest.cs b/src/Samples.UITest/Writer.Test/Tests/WriterTest.cs index 758c0a81..6114caf7 100644 --- a/src/Samples.UITest/Writer.Test/Tests/WriterTest.cs +++ b/src/Samples.UITest/Writer.Test/Tests/WriterTest.cs @@ -105,6 +105,9 @@ public void NewSaveRestartOpenChangeAskToSave() saveChangesWindow.YesButton.Click(); var saveFileDialog = window.FirstModalWindow().As(); + Log.WriteLine("---------"); + Log.WriteLine(saveFileDialog.GetTree()); + Log.WriteLine("---------"); var fileName = GetTempFileName("rtf"); saveFileDialog.FileName.EditableText = fileName; saveFileDialog.SaveButton.Click(); diff --git a/src/Samples.UITest/Writer.Test/Views/SaveFileDialog.cs b/src/Samples.UITest/Writer.Test/Views/SaveFileDialog.cs index ebeb8a15..7b52bd0c 100644 --- a/src/Samples.UITest/Writer.Test/Views/SaveFileDialog.cs +++ b/src/Samples.UITest/Writer.Test/Views/SaveFileDialog.cs @@ -1,5 +1,6 @@ using FlaUI.Core; using FlaUI.Core.AutomationElements; +using FlaUI.Core.Definitions; namespace UITest.Writer.Views; @@ -7,7 +8,7 @@ public class SaveFileDialog(FrameworkAutomationElementBase element) : Window(ele { public ComboBox FileName => this.Find("FileNameControlHost").AsComboBox(); - public Button SaveButton => this.Find("1").AsButton(); + public Button SaveButton => this.Find(x => x.ByControlType(ControlType.Button).And(x.ByAutomationId("1"))).AsButton(); - public Button CancelButton => this.Find("2").AsButton(); + public Button CancelButton => this.Find(x => x.ByControlType(ControlType.Button).And(x.ByAutomationId("2"))).AsButton(); }