Capture the Class Name and the Locator String of all Child Objects using the SilkTest Open Agent
The following sample function accepts a Window in 4Test and then performs the following objectives
1) Returns all of the class names for child objects on a window
2) Returns all of the locator strings for each child objects
3) Verifies whether each object exists
Print Out showing the Class Name, The locator String and whether or not the Object Exists.
The only caveat is that in the frame file you may need to separate each individual HTML page of a WebApplication hierarchy into its own individual window; so that you can pass a window into the function: GetWindowsAndClasses. For example, in the screenshot below I have changed the “BrowserWindow” control from a child control of BrowserApplication to a Window so that it can be passed as a parameter to the function GetWindowsAndClasses()
(Please view attached project file for further details)