GetAgentType Function

Class

AnyWin.

Action

Returns the Silk Test agent type, Classic Agent or Open Agent, for the specified window declaration.

Syntax

sAgentType = window.GetAgentType()
Variable Description
sAgentType The type of agent, Classic_Agent or Open_Agent, that the window declaration uses. STRING.

Notes

Silk Test Classic determines which Silk Test agent to use by detecting whether a locator or Find or FindAll command is used. If no locator or Find or FindAll command is present, Silk Test Classic uses the Classic Agent.

In earlier releases, the TAG_IS_OPEN_AGENT tag was defined on the root window declaration of a control hierarchy to identify that the Open Agent should be used. This is no longer necessary. When Silk Test Classic detects a locator on the top-most window or detects a Find or FindAll command, the Open Agent is automatically used.

Example

In the following script, the Notepad application (notepad.exe) has been set up to use the Open Agent and extensions have been enabled.

[-] testcase TestGetAgentType()
	[ ] // OPEN_AGENT, CLASSIC_AGENT are constants defined in 4test.inc
	[ ] Verify(NotepadOA.GetAgentType(), OPEN_AGENT)
	[ ] Verify(NotepadCA.GetAgentType(), CLASSIC_AGENT)