GetLocators Function

Class

AnyWin class.

Action

Returns a list of locator strings for the window.

Availability

This functionality is supported only if you are using the Open Agent.

Syntax

lsLocators = GetLocators()
Variable Description
lsLocators The locator strings for the window. LIST OF STRING.

Notes

  • GetLocators returns complete locator strings even when shortened locators are specified in the window declaration.

  • Each entry in the list represents the locator of one hierarchy in the hierarchy of the window.

  • GetLocators is similar to the GetTag function, which returns the complete tag for a window.

Example

[-] window MainWin TestApplication
	[ ] locator "Test Application"
	[-] DialogBox CheckBox
		[-] locator "Check Box"
			[-] PushButton Exit
				[ ] locator "Exit"
[ ] 
[ ] ListPrint(TestApplication.CheckBox.Exit.GetLocators())
[ ] //Window[@caption='Test Application']
[ ] //Dialog[@caption='Check Box']
[ ] //PushButton[@caption='Exit']