FlaUI |无法找到 DevExpress 控件 Combobox

问题描述 投票:0回答:0

我们正在使用 DevExpress 控件 18.2v。无法提取devexpress组合框编辑使用FlaUI实现自动化测试

我使用下面的代码尝试了多种方法(Xpath、进程 ID 等,但没有成功。),无法获得对组合框的引用;下面的语句返回 null.

using (var app = FlaUI.Core.Application.Launch(@"MYAPP.EXE")) 
    {
        try
        {
            using (var automation = new UIA3Automation())
            {
                var mainWindow = app.GetMainWindow(automation);
                
                ConditionFactory cf = new ConditionFactory(new UIA3PropertyLibrary());
                
                var searchOptionSelection = mainWindow.FindFirstDescendant(cf.ByAutomationId("cmbSearch")); //?.Select(1);
                
                var searchOptionSelection11 = mainWindow.FindFirstDescendant(cf.ByClassName("WindowsForms10.Window.b.app.0.134c08f_r6_ad1"));
               
                var searchOptionSelection1 = mainWindow.FindFirstByXPath(@"/Window[3]/Pane[4]/Window[1]/Pane/Pane[1]/Pane/Pane/Tab/Pane/Pane/ComboBox"); //?.Select(1);
                
                searchOptionSelection1 = mainWindow.FindFirstByXPath("//ComboBox[@AutomationId=cmbSearch]");
                
                var cmbSearchButton = mainWindow.FindFirstDescendant(cf.ByName("Open")).AsButton(); //ComboBox edit button
                
                var searchOptionSelection2 = mainWindow.FindAll(FlaUI.Core.Definitions.TreeScope.Descendants, cf.ByAutomationId("cmbSearch"));
                
        }
        finally
        {
            //dispose objects
        }
    }

Autommation id screenshot

非常感谢任何帮助!

winforms ui-automation flaui
© www.soinside.com 2019 - 2024. All rights reserved.