Functional Tester soporta un RootTestObject que representa una vista global del software que se está probando. Para efectuar una búsqueda global, invoque al método de búsqueda en RootTestObject. La invocación de un método de búsqueda TestObject sólo buscará los hijos de ese objeto de prueba.
El primer argumento del método de búsqueda es un subelemento para las propiedades de la búsqueda. El segundo argumento opcional es un distintivo que indica si sólo deben incluirse en la búsqueda los hijos de la correlación de objetos de prueba. Los valores válidos para los subelementos de propiedades son:
El primer elemento de la lista se compara para obtener una lista de candidatos, y de estos se comparan sus descendientes con el elemento siguiente de la lista, y así sucesivamente.
Existen propiedades especiales que se aplican a RootTestObject.find, entre ellas:
Ejemplos:
Dim FoundTOs As TestObject() Dim Root As RootTestObject Root = RootTestObject.GetRootTestObject() ' Find all toplevel windows in the Windows domain with ' caption "My Document" Dim Caption As CaptionText Caption = New CaptionText("My Document") FoundTOs = Root.Find(AtChild(".Domain", "Win", _ ".caption", Caption)) ' Find any dialogs, then return their children ' "OK" buttons. Dim DialogRE As RegularExpression = New _ RegularExpression("*dialog", false) Dim ButtonRE As RegularExpression = 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. Dim P1 As ProcessTestObject = StartApp("Notepad") Dim Pid As Integer = 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. Dim HWnd As Long = 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. Dim Handle As Long = GetAppsHwnd() FoundTOs = Root.Find(AtChild("Handle", Handle, ".domain", "Net"))