Windows 응용 프로그램을 자동화하고 있습니다. 탭 컨트롤 아래에있는 창 요소 (텍스트 상자, 콤보 상자 컨트롤 있음)에 액세스하려고했지만 액세스 할 수 없습니다. 흰색은 null을 반환합니다.흰색/UI 자동화가 탭의 컨테이너 (창 컨트롤)를 인식하지 못합니다.
UI 자동화 TreeWalker (Rawview, 컨트롤보기, 내용보기)와 같은 다른 기술을 시도했지만 아무 도움이되지 않았습니다.
아래 링크에서 이미지를 참조하십시오 https://dl.dropboxusercontent.com/u/68446125/Tab.png https://dl.dropboxusercontent.com/u/68446125/General%20Pane.png
사진 1에서와 같이, 탭 컨트롤은 화이트/UI 자동화에 의해 제대로 검색되지만, 자식 요소는 일반 * 창은 반환되지 않으며이 컨트롤에 액세스 할 수 없습니다입니다 (강조 표시된 그림 2 참조) 첫 번째로 액세스 할 수있는 자식 요소는 "일반 * 탭 항목"입니다.
이상한 것은 Inspect.exe (Windows SDK)에서 이러한 컨트롤에 액세스 할 수 있다는 것입니다. 나는 컨트롤을 검색하기 위해 다음과 같은 방법을 시도했지만 General/Pane은 화이트/UI 자동화를 통해 액세스 할 수 없다.
var tab = Window.Get<Tab>(SearchCriteria.ByControlType(ControlType.Tab).AndByClassName("TwoPageControl")); // Tab control is retrieved properly
var pane = tab.GetElement(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*")); // this line returns NULL
var pane1 = revWindow.GetElement(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*")); // this line returns NULL
var pane2 = revWindow.Get<Panel>(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*"));// throws exception "Failed to get ControlType=pane,Name=General*,ControlType=pane"
시도한 Windows UI 자동화 코드뿐만 아니라 운.
System.Windows.Automation.Condition cd1 = new AndCondition(
new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Tab),
new PropertyCondition(AutomationElement.ClassNameProperty, "TwoPageControl"));
AutomationElement a = window.FindFirst(TreeScope.Descendants, cd1); // Tab control is returned properly here
TreeWalker rawViewWalker = TreeWalker.RawViewWalker;
AutomationElement cc = rawViewWalker.GetFirstChild(a); // General * Pane is not returned, instead General* Tab item is returned, though it's not the first child.
var cd = rawViewWalker.GetNextSibling(cc); // this returns next pane element available, not General * Pane.
일반 * 창과 탭 컨트롤 아래의 자녀에 대한 액세스 방법을 도와주세요. 어떤 도움이라도 대단히 감사합니다.