TestObjects 검색

Functional Tester는 지정된 검색 기준과 일치하는 하나 이상의 TestObjects를 찾는 방법을 지원합니다. 검색은 찾고 있는 TestObject 또는 TestObjects의 특성을 나타내는 이름/값 쌍을 기반으로 합니다. 검색은 글로벌이거나 상위 TestObject의 하위로 제한될 수 있습니다.

Functional Tester는 RootTestObject를 지원하여 테스트 중엔 소프트웨어의 글로벌 보기를 나타냅니다. 글로벌 검색을 수행하려면 RootTestObject에서 찾기 메소드를 호출합니다. TestObject 찾기 메소드를 호출하면 TestObject의 하위만을 검색합니다.

찾기 메소드의 첫 번째 인수는 검색 특성의 부속 항목입니다. 두 번째 선택적 인수는 테스트 오브젝트 맵에 포함될 수 있는 하위만을 검색해야 하는지 표시하는 플래그입니다. 특성 부속 항목에 올바른 값은 다음과 같습니다.

다음을 포함하여 RootTestObject.find에 적용되는 특수 특성입니다.

예제:

TestObject[] foundTOs ;
RootTestObject root = RootTestObject.getRootTestObject() ;
// Find all toplevel windows in the Windows domain with caption "My
// Document"
CaptionText caption = new CaptionText("My Document") ;
foundTOs = root.find(atChild(".domain", "Win", ".caption",
     caption)) ;

// Find any dialogs, then return their children
// "OK" buttons.
RegularExpression dialogRE = new
     RegularExpression("*dialog", false) ;
RegularExpression buttonRE = new
     RegularExpression("*button", false) ;
foundTOs = root.find(atList(atDescendant(".class",
                     dialogRE), 
                     atChild(".class", buttonRE,".value", 
                     "OK"))) ;

// Start Notepad, dynamically enable that process,
// find its top-level window that matches the process id
// and get its descendant text window.
	ProcessTestObject p1 = StartApp("Notepad") ;
	Integer pid = new Integer((int)p1.getProcessId()) ;
	foundTOs = root.find(atList(atProperty(".processId",
     pid), atDescendant(".class", ".text"))) ;
 
// This enables a Windows app with the provided window handle and returns a
// TestObject representing the window.
Long hWnd = getAppsHwnd();
foundTOs = root.find(atChild(".hwnd", hWnd, ".domain", "Win"));

// This enables a .NET app with the provided window handle and returns a
// TestObject representing the window.
Long handle = getAppsHwnd();
foundTOs = root.find(atChild("Handle", handle, ".domain", "Net"));

피드백